mirror of
https://github.com/recp/cglm.git
synced 2025-12-24 12:32:40 +00:00
tests: update test design to test both call and inline versions
This commit is contained in:
@@ -54,10 +54,18 @@ typedef struct test_entry_t {
|
||||
#define TEST_OK 1
|
||||
#define TEST_SUCCESS return (test_status_t){NULL, TEST_OK};
|
||||
|
||||
#define TEST_IMPL(FUN) \
|
||||
#define TEST_IMPL_ARG1(FUN) \
|
||||
test_status_t test_ ## FUN (void); \
|
||||
test_status_t test_ ## FUN()
|
||||
|
||||
#define TEST_IMPL_ARG2(PREFIX, FUN) TEST_IMPL_ARG1(PREFIX ## FUN)
|
||||
#define TEST_IMPL_ARG3(arg1, arg2, arg3, ...) arg3
|
||||
|
||||
#define TEST_IMPL_CHOOSER(...) \
|
||||
TEST_IMPL_ARG3(__VA_ARGS__, TEST_IMPL_ARG2, TEST_IMPL_ARG1)
|
||||
|
||||
#define TEST_IMPL(...) TEST_IMPL_CHOOSER(__VA_ARGS__)(__VA_ARGS__)
|
||||
|
||||
#define ASSERT_EXT(expr, msg) \
|
||||
if (!(expr)) { \
|
||||
fprintf(stderr, \
|
||||
|
||||
Reference in New Issue
Block a user