Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/gen - check the results of the vis functions



details:   https://anonhg.NetBSD.org/src/rev/d14f425e47c2
branches:  trunk
changeset: 784887:d14f425e47c2
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Feb 13 04:51:56 2013 +0000

description:
- check the results of the vis functions
- zero output to make sure things work
- don't use encodings that don't work
- fix the style on decoding

diffstat:

 tests/lib/libc/gen/t_vis.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (20 lines):

diff -r b8728c684633 -r d14f425e47c2 tests/lib/libc/gen/t_vis.c
--- a/tests/lib/libc/gen/t_vis.c        Wed Feb 13 04:49:59 2013 +0000
+++ b/tests/lib/libc/gen/t_vis.c        Wed Feb 13 04:51:56 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_vis.c,v 1.5 2013/02/11 04:12:48 christos Exp $       */
+/*     $NetBSD: t_vis.c,v 1.6 2013/02/13 04:51:56 christos Exp $       */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -76,7 +76,9 @@
 
        for (i = 0; i < __arraycount(styles); i++) {
                ATF_REQUIRE(strsvisx(visbuf, srcbuf, SIZE, styles[i], "") > 0);
-               ATF_REQUIRE(strunvisx(dstbuf, visbuf, styles[i]) > 0);
+               memset(dstbuf, 0, SIZE);
+               ATF_REQUIRE(strunvisx(dstbuf, visbuf, 
+                   styles[i] & (VIS_HTTP1808|VIS_MIMESTYLE)) > 0);
                for (j = 0; j < SIZE; j++)
                        if (dstbuf[j] != (char)j)
                                atf_tc_fail_nonfatal("Failed for style %x, "



Home | Main Index | Thread Index | Old Index