Skip to content

Commit 6e63489

Browse files
committed
test.h: silence gcc warnings about unused results
This is not perfect, and gcc warnings are often unpredictable (generally what you don't want warnings to be). But seems to work for now. Signed-off-by: Yuxuan Shui <[email protected]>
1 parent 7094d7a commit 6e63489

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

subprojects/test.h/test.h

+2-6
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,8 @@ static inline void __attribute__((constructor(102))) run_tests(void) {
222222

223223
#define TEST_CASE(name) static void __attribute__((unused)) __test_h_##name(void)
224224

225-
#define TEST_EQUAL(a, b) \
226-
(void)(a); \
227-
(void)(b)
228-
#define TEST_NOTEQUAL(a, b) \
229-
(void)(a); \
230-
(void)(b)
225+
#define TEST_EQUAL(a, b) (void)((a) == (b))
226+
#define TEST_NOTEQUAL(a, b) (void)((a) != (b))
231227
#define TEST_TRUE(a) (void)(a)
232228
#define TEST_STREQUAL(a, b) \
233229
(void)(a); \

0 commit comments

Comments
 (0)