summaryrefslogtreecommitdiff
path: root/test/assert.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/assert.h')
-rw-r--r--test/assert.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/assert.h b/test/assert.h
new file mode 100644
index 0000000..8b730b2
--- /dev/null
+++ b/test/assert.h
@@ -0,0 +1,10 @@
+#include <stdbool.h>
+
+#define ASSERT(cond, msg) assert(cond, #cond, __FILE__, __LINE__, msg)
+#define ASSERT_STR_EQ(left, right, msg) \
+ assert_streq(left, right, __FILE__, __LINE__, msg)
+
+void assert(bool cond, const char *cond_str, const char *file, int line,
+ const char *msg);
+void assert_streq(const char *left, const char *right, const char *file,
+ int line, const char *msg);