aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2025-02-12 16:33:32 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2025-02-12 16:33:32 -0500
commit4e8732a2ad94982dcde175a6518da33021d2b6e8 (patch)
tree15007ccd3d06e41060b26f36fca3da24023f550e /tests
parentafecc407fd0d36061169ae64164703382656cafe (diff)
downloadstasis-4e8732a2ad94982dcde175a6518da33021d2b6e8.tar.gz
Encapsulate macro arguments in parentheses
Diffstat (limited to 'tests')
-rw-r--r--tests/include/testing.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/include/testing.h b/tests/include/testing.h
index 4c97bf2..5ff847b 100644
--- a/tests/include/testing.h
+++ b/tests/include/testing.h
@@ -211,7 +211,7 @@ inline void stasis_testing_teardown_workspace() {
.lineno = __LINE__, \
.status = (COND), \
.msg_assertion = "ASSERT(" #COND ")", \
- .msg_reason = REASON } ); \
+ .msg_reason = (REASON) } ); \
} while (0)
#define STASIS_ASSERT_FATAL(COND, REASON) do { \
@@ -221,7 +221,7 @@ inline void stasis_testing_teardown_workspace() {
.lineno = __LINE__, \
.status = (COND), \
.msg_assertion = "ASSERT FATAL (" #COND ")", \
- .msg_reason = REASON } \
+ .msg_reason = (REASON) } \
); \
if (stasis_test_results[stasis_test_results_i ? stasis_test_results_i - 1 : stasis_test_results_i].status == false) {\
exit(STASIS_TEST_SUITE_FATAL); \
@@ -236,7 +236,7 @@ inline void stasis_testing_teardown_workspace() {
.status = true, \
.skip = (COND), \
.msg_assertion = "SKIP (" #COND ")", \
- .msg_reason = REASON } \
+ .msg_reason = (REASON) } \
); \
if (stasis_test_results[stasis_test_results_i ? stasis_test_results_i - 1 : stasis_test_results_i].skip == true) {\
return; \
@@ -244,9 +244,9 @@ inline void stasis_testing_teardown_workspace() {
} while (0)
#define STASIS_TEST_RUN(X) do { \
- for (size_t i = 0; i < sizeof(X) / sizeof(*X); i++) { \
- if (X[i]) { \
- X[i](); \
+ for (size_t i = 0; i < sizeof(X) / sizeof(*(X)); i++) { \
+ if ((X)[i]) { \
+ (X)[i](); \
} \
} \
} while (0)