From: Hood Chatham Date: Sun, 27 Jun 2021 18:02:33 +0000 (-0700) Subject: Print more information when an assertion fails in test suite (#649) X-Git-Tag: upstream/3.4.2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9fa94c607852081adce33547bde292fe4313cff7;p=platform%2Fupstream%2Flibffi.git Print more information when an assertion fails in test suite (#649) --- 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__