summaryrefslogtreecommitdiff
path: root/fzytest.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john.hawthorn@gmail.com>2014-09-27 16:43:40 -0700
committerJohn Hawthorn <john.hawthorn@gmail.com>2014-09-27 16:50:08 -0700
commit0826e522f4c802e499387f4928a4984595c4c759 (patch)
tree4fdded04bbba6100bef69cf367362d08783baeb2 /fzytest.c
parent78bf67c0d30cbd121a34c9fee5def678f0c027e7 (diff)
Reformat assert macro
Diffstat (limited to 'fzytest.c')
-rw-r--r--fzytest.c8
1 files changed, 7 insertions, 1 deletions
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))