diff options
| author | ray <> | 2006-03-10 05:28:57 +0000 |
|---|---|---|
| committer | ray <> | 2006-03-10 05:28:57 +0000 |
| commit | 0e4c028f259a495117fc1554560b1daf1bdf919b (patch) | |
| tree | ff5d1ed5ab8dd8e35d631c63c5d98f16bcc68ceb | |
| parent | f79af607fea8db71524b8a4a1553fb437b284616 (diff) | |
| download | openbsd-0e4c028f259a495117fc1554560b1daf1bdf919b.tar.gz openbsd-0e4c028f259a495117fc1554560b1daf1bdf919b.tar.bz2 openbsd-0e4c028f259a495117fc1554560b1daf1bdf919b.zip | |
Regression test for truncated file.
ok otto and millert
Diffstat (limited to '')
| -rw-r--r-- | src/regress/lib/libc/getcap/Makefile | 10 | ||||
| -rw-r--r-- | src/regress/lib/libc/getcap/getcaptest.c | 26 | ||||
| -rw-r--r-- | src/regress/lib/libc/getcap/shortcap.in | 1 |
3 files changed, 37 insertions, 0 deletions
diff --git a/src/regress/lib/libc/getcap/Makefile b/src/regress/lib/libc/getcap/Makefile new file mode 100644 index 0000000000..d09c9846cc --- /dev/null +++ b/src/regress/lib/libc/getcap/Makefile | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.1 2006/03/10 05:28:57 ray Exp $ | ||
| 2 | |||
| 3 | PROG= getcaptest | ||
| 4 | |||
| 5 | REGRESS_TARGETS=shortcap | ||
| 6 | |||
| 7 | shortcap: | ||
| 8 | ./getcaptest ${.CURDIR}/shortcap.in | ||
| 9 | |||
| 10 | .include <bsd.regress.mk> | ||
diff --git a/src/regress/lib/libc/getcap/getcaptest.c b/src/regress/lib/libc/getcap/getcaptest.c new file mode 100644 index 0000000000..0f4464b6c5 --- /dev/null +++ b/src/regress/lib/libc/getcap/getcaptest.c | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | /* $OpenBSD: getcaptest.c,v 1.1 2006/03/10 05:28:57 ray Exp $ */ | ||
| 2 | |||
| 3 | /* | ||
| 4 | * Written by Raymond Lai <ray@cyth.net>. | ||
| 5 | * Public domain. | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include <stdio.h> | ||
| 9 | #include <stdlib.h> | ||
| 10 | |||
| 11 | int | ||
| 12 | main(int argc, char *argv[]) | ||
| 13 | { | ||
| 14 | char *buf, *db_array[2]; | ||
| 15 | |||
| 16 | if (argc != 2) | ||
| 17 | return (1); | ||
| 18 | |||
| 19 | db_array[0] = argv[1]; | ||
| 20 | db_array[1] = NULL; | ||
| 21 | |||
| 22 | while (cgetnext(&buf, db_array) > 0) | ||
| 23 | puts(buf); | ||
| 24 | |||
| 25 | return (0); | ||
| 26 | } | ||
diff --git a/src/regress/lib/libc/getcap/shortcap.in b/src/regress/lib/libc/getcap/shortcap.in new file mode 100644 index 0000000000..573541ac97 --- /dev/null +++ b/src/regress/lib/libc/getcap/shortcap.in | |||
| @@ -0,0 +1 @@ | |||
| 0 | |||
