summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorHood Chatham <hood@mit.edu>2021-06-27 11:02:33 -0700
committerGitHub <noreply@github.com>2021-06-27 14:02:33 -0400
commit9fa94c607852081adce33547bde292fe4313cff7 (patch)
tree6f93eb349d7761eb6ce6ed38b63872d463e9ca4a /testsuite
parent91eaadfb2e4b79d12a45d24002b06563e5905e5d (diff)
downloadlibffi-9fa94c607852081adce33547bde292fe4313cff7.tar.gz
Print more information when an assertion fails in test suite (#649)
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/libffi.call/ffitest.h8
-rw-r--r--testsuite/libffi.closures/ffitest.h8
2 files changed, 14 insertions, 2 deletions
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__