diff options
author | John Hawthorn <john.hawthorn@gmail.com> | 2014-09-27 16:43:40 -0700 |
---|---|---|
committer | John Hawthorn <john.hawthorn@gmail.com> | 2014-09-27 16:50:08 -0700 |
commit | 0826e522f4c802e499387f4928a4984595c4c759 (patch) | |
tree | 4fdded04bbba6100bef69cf367362d08783baeb2 /fzytest.c | |
parent | 78bf67c0d30cbd121a34c9fee5def678f0c027e7 (diff) |
Reformat assert macro
Diffstat (limited to 'fzytest.c')
-rw-r--r-- | fzytest.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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)) |