aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorc2024-01-28 22:58:01 -0500
committerc2024-01-28 22:58:01 -0500
commit0b84414bdde53b367bc28563a6936513c4d3b50c (patch)
treee7f650d47d0295049d3f5e8fa9164080dacaee45 /test
parentca20ff4f4d0ac63856e538f9f4cef97197bf6465 (diff)
Macro Hell.
Diffstat (limited to 'test')
-rw-r--r--test/include/test.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/test/include/test.h b/test/include/test.h
index 8cde34d..7366aa2 100644
--- a/test/include/test.h
+++ b/test/include/test.h
@@ -18,13 +18,17 @@ extern unsigned int TESTS_PASSED;
#define ASSERT(EXPR) \
TESTS_RUN++; \
- (EXPR && ++TESTS_PASSED) ? \
- log_inf("%s:%s:%d: Assertion passed!", __FILE__, __func__, __LINE__) : \
- log_err("%s:%s:%d: Assertion failed:\n\t%s", __FILE__, __func__, __LINE__, #EXPR);
+ if (EXPR && ++TESTS_PASSED) { \
+ LOG_INF("%s:%s:%d: Assertion passed!", __FILE__, __func__, __LINE__); \
+ } else { \
+ LOG_ERR("%s:%s:%d: Assertion failed:\n\t%s", __FILE__, __func__, __LINE__, #EXPR); \
+ }
#define TEST_REPORT \
- (TESTS_RUN == TESTS_PASSED) ? \
- log_yay("%s: All %d tests passed!", __FILE__, TESTS_RUN) : \
- log_err("%d/%d tests failed.", TESTS_RUN - TESTS_PASSED, TESTS_RUN);
+ if (TESTS_RUN == TESTS_PASSED) { \
+ LOG_YAY("%s: All %d tests passed!", __FILE__, TESTS_RUN); \
+ } else { \
+ LOG_ERR("%d/%d tests failed.", TESTS_RUN - TESTS_PASSED, TESTS_RUN); \
+ }
#endif