diff options
Diffstat (limited to 'tests/test.h')
-rw-r--r-- | tests/test.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/test.h b/tests/test.h index 23bcd48..36dc397 100644 --- a/tests/test.h +++ b/tests/test.h @@ -71,10 +71,18 @@ char * error_string[] = { # undef assert #endif +#ifndef ASSERT_TRACE +#define ASSERT_TRACE 0 +#endif + #define assert(e) \ - ((e) ? (void) 0 : \ - (fprintf(stderr, "Assertion failed: (%s), file %s, line %d\n", \ - #e, __FILE__, (int) __LINE__), exit(1))) + ((e) ? ((ASSERT_TRACE) ? fprintf(stderr, \ + "Assertion succeeded: (%s), file %s, line %d\n", \ + #e, __FILE__, (int) __LINE__), \ + fflush(stderr) : \ + (void) 0) : \ + (fprintf(stderr, "Assertion failed: (%s), file %s, line %d\n", \ + #e, __FILE__, (int) __LINE__), exit(1))) #endif /* NDEBUG */ |