diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-10-17 15:41:01 -0400 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-10-17 15:41:01 -0400 |
| commit | 801aeb9172136ca93a4603fcf8dcf8e19a1522fe (patch) | |
| tree | 3e55e80388c53188d042bb3ced3dad36c510abf9 /include/kpl_test.h | |
| parent | 6673bb9357b9ed8187f3dcb2917e2c6a9da25ee7 (diff) | |
add io_uring
Diffstat (limited to 'include/kpl_test.h')
| -rw-r--r-- | include/kpl_test.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/kpl_test.h b/include/kpl_test.h index 70a99b2..6a423eb 100644 --- a/include/kpl_test.h +++ b/include/kpl_test.h @@ -29,21 +29,23 @@ typedef struct _kpl_test { void _kpl_test_add(kpl_test *_test); // do not call outside KPL_TEST macro -#define _KPL_TEST_FN_DEFINITION(NAME) static void NAME(__attribute__((unused)) kpl_test *_test) +#define _KPL_TEST_FN_NAME(NAME) kpl_test_ ## NAME + +#define _KPL_TEST_FN_DEFINITION(NAME) static void _KPL_TEST_FN_NAME(NAME)(__attribute__((unused)) kpl_test *_test) /* * Each test is a static function added to the test list and tree by a static gnu constructor function * The NAME becomes the function name _NAME becomes the constructor name, only one name can be used per file */ #define KPL_TEST(NAME) _KPL_TEST_FN_DEFINITION(NAME); \ -static void __attribute__((constructor)) _ ## NAME(void) { \ +static void __attribute__((constructor)) kpl_test_constructor_ ## NAME(void) { \ static kpl_test _test = { \ .tree_left = NULL, .tree_right = NULL, .tree_duplicates = NULL, \ .tree_height = KPL_TREE_TREE_HEIGHT_INIT, \ .error_line_number = KPL_TEST_ERROR_LINE_NUMBER_INIT, \ .list_next = NULL, \ .source_file = __FILE__, .name = #NAME, .error_message = NULL, \ - .test_fn = NAME \ + .test_fn = _KPL_TEST_FN_NAME(NAME) \ }; \ _kpl_test_add(&_test); \ } \ |
