summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--regress/lib/libc/Makefile4
-rw-r--r--regress/lib/libc/vis/Makefile10
-rw-r--r--regress/lib/libc/vis/valid.ok2
-rw-r--r--regress/lib/libc/vis/vis_test.c23
4 files changed, 37 insertions, 2 deletions
diff --git a/regress/lib/libc/Makefile b/regress/lib/libc/Makefile
index f9dd0ad3bbc..f1d1a0d87e6 100644
--- a/regress/lib/libc/Makefile
+++ b/regress/lib/libc/Makefile
@@ -1,9 +1,9 @@
-# $OpenBSD: Makefile,v 1.20 2005/08/12 00:28:08 deraadt Exp $
+# $OpenBSD: Makefile,v 1.21 2005/08/29 18:41:56 otto Exp $
SUBDIR+= _setjmp alloca atexit db getaddrinfo getopt_long hsearch longjmp
SUBDIR+= locale malloc
SUBDIR+= netdb popen regex setjmp setjmp-signal sigreturn sigsetjmp
-SUBDIR+= sprintf strerror strtonum time
+SUBDIR+= sprintf strerror strtonum time vis
.if (${MACHINE_ARCH} != "vax")
SUBDIR+= ieeefp
diff --git a/regress/lib/libc/vis/Makefile b/regress/lib/libc/vis/Makefile
new file mode 100644
index 00000000000..13e560bbf7d
--- /dev/null
+++ b/regress/lib/libc/vis/Makefile
@@ -0,0 +1,10 @@
+# $OpenBSD: Makefile,v 1.1 2005/08/29 18:41:56 otto Exp $
+
+PROG= vis_test
+CLEANFILES+= valid.out
+
+run-regress-vis_test: ${PROG}
+ ./${PROG} >${.OBJDIR}/valid.out
+ cmp -s ${.OBJDIR}/valid.out ${.CURDIR}/valid.ok
+
+.include <bsd.regress.mk>
diff --git a/regress/lib/libc/vis/valid.ok b/regress/lib/libc/vis/valid.ok
new file mode 100644
index 00000000000..f8c0efa5037
--- /dev/null
+++ b/regress/lib/libc/vis/valid.ok
@@ -0,0 +1,2 @@
+\^@\^A\^B\^C\^D\^E\^F\^G\^H
+\^K\^L\^M\^N\^O\^P\^Q\^R\^S\^T\^U\^V\^W\^X\^Y\^Z\^[\^\\^]\^^\^_ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\^?\M^@\M^A\M^B\M^C\M^D\M^E\M^F\M^G\M^H\M^I\M^J\M^K\M^L\M^M\M^N\M^O\M^P\M^Q\M^R\M^S\M^T\M^U\M^V\M^W\M^X\M^Y\M^Z\M^[\M^\\M^]\M^^\M^_\240\M-!\M-"\M-#\M-$\M-%\M-&\M-'\M-(\M-)\M-*\M-+\M-,\M--\M-.\M-/\M-0\M-1\M-2\M-3\M-4\M-5\M-6\M-7\M-8\M-9\M-:\M-;\M-<\M-=\M->\M-?\M-@\M-A\M-B\M-C\M-D\M-E\M-F\M-G\M-H\M-I\M-J\M-K\M-L\M-M\M-N\M-O\M-P\M-Q\M-R\M-S\M-T\M-U\M-V\M-W\M-X\M-Y\M-Z\M-[\M-\\M-]\M-^\M-_\M-`\M-a\M-b\M-c\M-d\M-e\M-f\M-g\M-h\M-i\M-j\M-k\M-l\M-m\M-n\M-o\M-p\M-q\M-r\M-s\M-t\M-u\M-v\M-w\M-x\M-y\M-z\M-{\M-|\M-}\M-~\M^?
diff --git a/regress/lib/libc/vis/vis_test.c b/regress/lib/libc/vis/vis_test.c
new file mode 100644
index 00000000000..40e5d9f5032
--- /dev/null
+++ b/regress/lib/libc/vis/vis_test.c
@@ -0,0 +1,23 @@
+/* $OpenBSD */
+
+/* Public domain. 2005, Otto Moerbeek */
+
+#include <limits.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <vis.h>
+
+int
+main()
+{
+ char inp[UCHAR_MAX + 1];
+ char out[4 * UCHAR_MAX + 1];
+ int i;
+
+ for (i = 0; i <= UCHAR_MAX; i++) {
+ inp[i] = i;
+ }
+ strvisx(out, inp, UCHAR_MAX + 1, 0);
+ printf("%s\n", out);
+ exit(0);
+}