diff options
author | marc <> | 2002-01-02 23:26:57 +0000 |
---|---|---|
committer | marc <> | 2002-01-02 23:26:57 +0000 |
commit | 1d7eeb19d97de8941dc2adcdaf398fc0fa1021f0 (patch) | |
tree | 96d15bdf6adba2e953592df970a7dbfabf49584c /src | |
parent | 4f30fe57b0192300ebaeb9dd5367a67c78c9625a (diff) | |
download | openbsd-1d7eeb19d97de8941dc2adcdaf398fc0fa1021f0.tar.gz openbsd-1d7eeb19d97de8941dc2adcdaf398fc0fa1021f0.tar.bz2 openbsd-1d7eeb19d97de8941dc2adcdaf398fc0fa1021f0.zip |
convert test prog into real regression test
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libc/sigreturn/sigret.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/regress/lib/libc/sigreturn/sigret.c b/src/regress/lib/libc/sigreturn/sigret.c index d7af5bc679..fb8bd9222f 100644 --- a/src/regress/lib/libc/sigreturn/sigret.c +++ b/src/regress/lib/libc/sigreturn/sigret.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $OpenBSD: sigret.c,v 1.2 2001/12/17 03:31:11 marc Exp $ | 2 | * $OpenBSD: sigret.c,v 1.3 2002/01/02 23:26:57 marc Exp $ |
3 | * | 3 | * |
4 | * Public Domain | 4 | * Public Domain |
5 | * | 5 | * |
@@ -20,7 +20,6 @@ | |||
20 | * | 20 | * |
21 | * -i: call sigreturn from a function called by the signal handler | 21 | * -i: call sigreturn from a function called by the signal handler |
22 | * | 22 | * |
23 | * Program should not exit until killed. | ||
24 | */ | 23 | */ |
25 | 24 | ||
26 | #include <sys/time.h> | 25 | #include <sys/time.h> |
@@ -33,6 +32,13 @@ | |||
33 | #include <string.h> | 32 | #include <string.h> |
34 | #include <unistd.h> | 33 | #include <unistd.h> |
35 | 34 | ||
35 | /* | ||
36 | * sigalarm occurs 50 times/second. Stop running after 10 seconds | ||
37 | * (100 interrupts). | ||
38 | */ | ||
39 | #define MAX_INTERRUPTS 500 | ||
40 | |||
41 | int failed; | ||
36 | int altstack; | 42 | int altstack; |
37 | int badcall; | 43 | int badcall; |
38 | int clobbercall; | 44 | int clobbercall; |
@@ -102,6 +108,7 @@ test2(char *fmt) | |||
102 | case 'p': | 108 | case 'p': |
103 | break; | 109 | break; |
104 | default: | 110 | default: |
111 | failed = 1; | ||
105 | fprintf(stderr, | 112 | fprintf(stderr, |
106 | "unexpected character 0x%02x `%c' in %s: count %d\n", | 113 | "unexpected character 0x%02x `%c' in %s: count %d\n", |
107 | *fmt, *fmt, ofmt, count); | 114 | *fmt, *fmt, ofmt, count); |
@@ -167,6 +174,8 @@ main(int argc, char * argv[]) | |||
167 | 174 | ||
168 | ualarm(10000, 10000); | 175 | ualarm(10000, 10000); |
169 | 176 | ||
170 | while (1) | 177 | while (count < MAX_INTERRUPTS) |
171 | test2("iclp"); | 178 | test2("iclp"); |
179 | |||
180 | return failed; | ||
172 | } | 181 | } |