diff options
author | Tharre <tharre3@gmail.com> | 2014-04-25 01:34:52 +0200 |
---|---|---|
committer | Tharre <tharre3@gmail.com> | 2014-04-25 02:31:01 +0200 |
commit | d46b48a448deb539aaf93acc4425972e10bf5061 (patch) | |
tree | 64ba651586bdbecb7d7cd782572df9340db73541 /src | |
parent | df54e75541786fb0d53b09706b35ed15b1cc493f (diff) | |
download | redo-d46b48a448deb539aaf93acc4425972e10bf5061.tar.gz redo-d46b48a448deb539aaf93acc4425972e10bf5061.tar.xz redo-d46b48a448deb539aaf93acc4425972e10bf5061.zip |
Add assert equal macros to dbg.h
Diffstat (limited to 'src')
-rw-r--r-- | src/dbg.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -30,4 +30,18 @@ #define fatal_(f,l,...) \ {FATAL_HELPER_(f, l, __VA_ARGS__, strerror(errno)); exit(EXIT_FAILURE);} +#define assert_str_equal(a,b) ({ \ + if (strcmp(a, b)) { \ + log_err("Assertion error: '%s' == '%s'\n", a, b); \ + abort(); \ + } \ +}) + +#define assert_int_equal(a,b) ({ \ + if (a != b) { \ + log_err("Assertion error: '%d' == '%d'\n", a, b); \ + abort(); \ + } \ +}) + #endif |