summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/check.h10
-rw-r--r--support/support_test_verify_impl.c12
2 files changed, 15 insertions, 7 deletions
diff --git a/support/check.h b/support/check.h
index 1d244a3557..bdcd12952a 100644
--- a/support/check.h
+++ b/support/check.h
@@ -51,7 +51,7 @@ __BEGIN_DECLS
if (expr) \
; \
else \
- support_test_verify_impl (-1, __FILE__, __LINE__, #expr); \
+ support_test_verify_impl (__FILE__, __LINE__, #expr); \
})
/* Record a test failure and exit if EXPR evaluates to false. */
@@ -60,7 +60,8 @@ __BEGIN_DECLS
if (expr) \
; \
else \
- support_test_verify_impl (1, __FILE__, __LINE__, #expr); \
+ support_test_verify_exit_impl \
+ (1, __FILE__, __LINE__, #expr); \
})
int support_print_failure_impl (const char *file, int line,
@@ -70,8 +71,11 @@ void support_exit_failure_impl (int exit_status,
const char *file, int line,
const char *format, ...)
__attribute__ ((noreturn, nonnull (2), format (printf, 4, 5)));
-void support_test_verify_impl (int status, const char *file, int line,
+void support_test_verify_impl (const char *file, int line,
const char *expr);
+void support_test_verify_exit_impl (int status, const char *file, int line,
+ const char *expr)
+ __attribute__ ((noreturn));
/* Record a test failure. This function returns and does not
terminate the process. The failure counter is stored in a shared
diff --git a/support/support_test_verify_impl.c b/support/support_test_verify_impl.c
index 5bae38f8b1..55ab2111b3 100644
--- a/support/support_test_verify_impl.c
+++ b/support/support_test_verify_impl.c
@@ -22,12 +22,16 @@
#include <stdlib.h>
void
-support_test_verify_impl (int status, const char *file, int line,
- const char *expr)
+support_test_verify_impl (const char *file, int line, const char *expr)
{
support_record_failure ();
printf ("error: %s:%d: not true: %s\n", file, line, expr);
- if (status >= 0)
- exit (status);
+}
+void
+support_test_verify_exit_impl (int status, const char *file, int line,
+ const char *expr)
+{
+ support_test_verify_impl (file, line, expr);
+ exit (status);
}