From c9929dd5ddc6e6d4eca08785aad7f6c543b06565 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 16 Nov 2006 21:47:57 +0000 Subject: make default output silence and have the exit status indicate error --- test/setjmp/jmpbug.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/test/setjmp/jmpbug.c b/test/setjmp/jmpbug.c index 125977b2f..4337e527a 100644 --- a/test/setjmp/jmpbug.c +++ b/test/setjmp/jmpbug.c @@ -4,6 +4,9 @@ #include #include +int ret; +int verbose; + static void sub5 (jmp_buf buf) { @@ -17,10 +20,14 @@ test (int x) char *foo; int arr[100]; + ++ret; + arr[77] = x; if (setjmp (buf)) { - printf ("made it ok; %d\n", arr[77]); + --ret; + if (verbose) + printf ("made it ok; %d\n", arr[77]); return; } @@ -29,12 +36,15 @@ test (int x) } int -main (void) +main (int argc, char *argv[]) { int i; + verbose = (argc != 1); + ret = 0; + for (i = 123; i < 345; ++i) test (i); - return 0; + return ret; } -- cgit v1.2.3