Print more information when an assertion fails in test suite (#649)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
diff --git a/testsuite/libffi.call/ffitest.h b/testsuite/libffi.call/ffitest.h
index cfce1ad..95d96a8 100644
--- a/testsuite/libffi.call/ffitest.h
+++ b/testsuite/libffi.call/ffitest.h
@@ -15,7 +15,13 @@
#define MAX_ARGS 256
-#define CHECK(x) (void)(!(x) ? (abort(), 1) : 0)
+#define CHECK(x) \
+ do { \
+ if(!(x)){ \
+ printf("Check failed:\n%s\n", #x); \
+ abort(); \
+ } \
+ } while(0)
/* Define macros so that compilers other than gcc can run the tests. */
#undef __UNUSED__
diff --git a/testsuite/libffi.closures/ffitest.h b/testsuite/libffi.closures/ffitest.h
index cfce1ad..95d96a8 100644
--- a/testsuite/libffi.closures/ffitest.h
+++ b/testsuite/libffi.closures/ffitest.h
@@ -15,7 +15,13 @@
#define MAX_ARGS 256
-#define CHECK(x) (void)(!(x) ? (abort(), 1) : 0)
+#define CHECK(x) \
+ do { \
+ if(!(x)){ \
+ printf("Check failed:\n%s\n", #x); \
+ abort(); \
+ } \
+ } while(0)
/* Define macros so that compilers other than gcc can run the tests. */
#undef __UNUSED__