Module Name: src
Committed By: christos
Date: Wed Feb 13 04:51:56 UTC 2013
Modified Files:
src/tests/lib/libc/gen: t_vis.c
Log Message:
- 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
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/gen/t_vis.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/lib/libc/gen/t_vis.c
diff -u src/tests/lib/libc/gen/t_vis.c:1.5 src/tests/lib/libc/gen/t_vis.c:1.6
--- src/tests/lib/libc/gen/t_vis.c:1.5 Sun Feb 10 23:12:48 2013
+++ src/tests/lib/libc/gen/t_vis.c Tue Feb 12 23:51:56 2013
@@ -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 @@ ATF_TC_BODY(strvis_basic, tc)
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, "