From 0826e522f4c802e499387f4928a4984595c4c759 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Sat, 27 Sep 2014 16:43:40 -0700 Subject: Reformat assert macro --- fzytest.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fzytest.c b/fzytest.c index ec81170..fc6f202 100644 --- a/fzytest.c +++ b/fzytest.c @@ -7,7 +7,13 @@ int testsrun = 0, testsfailed = 0, assertionsrun = 0; -#define assert(x) if(++assertionsrun && !(x)){fprintf(stderr, "test \"%s\" failed\n assert(%s) was false\n at %s:%i\n\n", __func__, #x, __FILE__ ,__LINE__);raise(SIGTRAP);testsfailed++;return;} +#define assert(x) \ + if(++assertionsrun && !(x)){ \ + fprintf(stderr, "test \"%s\" failed\n assert(%s) was false\n at %s:%i\n\n", __func__, #x, __FILE__ ,__LINE__); \ + raise(SIGTRAP); \ + testsfailed++; \ + return; \ + } #define assert_streq(a, b) assert(!strcmp(a, b)) -- cgit v1.2.3