diff options
Diffstat (limited to 'test/assert')
-rw-r--r-- | test/assert/assert.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/test/assert/assert.c b/test/assert/assert.c index 095609411..b0f54c625 100644 --- a/test/assert/assert.c +++ b/test/assert/assert.c @@ -16,29 +16,31 @@ int got_abort; void aborthandler(int junk) { - got_abort=1; + got_abort = 1; } -int main( int argc, char **argv) +int main(int argc, char *argv[]) { signal(SIGABRT, aborthandler); init_testsuite("Testing functions defined in assert.h:\n\t"); got_abort=0; - assert(0==0); + assert(0 == 0); TEST_NUMERIC(got_abort, 0); -#define NDEBUG - got_abort=0; +#ifndef NDEBUG +# define NDEBUG +#endif + got_abort = 0; printf("Don't worry -- This next test is supposed to print an assert message:\n"); fprintf(stderr, "\t"); - assert(0==1); + assert(0 == 1); TEST_NUMERIC(got_abort, 0); -#undef NDEBUG - got_abort=0; - assert(0==1); +#undef NDEBUG + got_abort = 0; + assert(0 == 1); TEST_NUMERIC(got_abort, 1); exit(0); |