]> git.lizzy.rs Git - nothing.git/blobdiff - test/test.h
Merge pull request #375 from tsoding/361
[nothing.git] / test / test.h
index 750575038badd2cc04b0d69db25a27e942c8b212..f8a092d8cef274d738410d14d62c5e353a5a817a 100644 (file)
     }
 
 #define ASSERT_TRUE(condition, message)                                 \
-    if (!condition) {                                                   \
+    if (!(condition)) {                                                 \
         fprintf(stderr, "\n%s:%d: ASSERT_TRUE: false\n",                \
                 __FILE__, __LINE__);                                    \
         fprintf(stderr, "%s\n", message);                               \
         return -1;                                                      \
     }
 
+#define ASSERT_FALSE(condition, message)                                \
+    if (condition) {                                                    \
+        fprintf(stderr, "\n%s:%d: ASSERT_FALSE: false\n",               \
+                __FILE__, __LINE__);                                    \
+        fprintf(stderr, "%s\n", message);                               \
+        return -1;                                                      \
+    }
+
 #define TEST_SUITE(name)                        \
     static int name##_body(void);               \
     static int name(void) {                     \