diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-09-16 14:52:09 -0400 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-09-16 14:52:09 -0400 |
| commit | 63cc458fc3d0df10c91ca5c859a656845d27a8ad (patch) | |
| tree | f3acf920ccb3c824919264b04f9aefc6d02563ba /include/kpl_test.h | |
| parent | c4dcbaa49a43ac4b536c50baafad41e3f6e4a43c (diff) | |
run test by matching string
Diffstat (limited to 'include/kpl_test.h')
| -rw-r--r-- | include/kpl_test.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/include/kpl_test.h b/include/kpl_test.h index 9f87db3..c1645e2 100644 --- a/include/kpl_test.h +++ b/include/kpl_test.h @@ -34,10 +34,12 @@ static void __attribute__((constructor)) _kpl_test_constructor_ ## NAME(void) { } \ _KPL_TEST_FN(NAME) -#define _KPL_TEST_FAIL_LINE _test->error_line_number = __LINE__ - -#define _KPL_TEST_FAIL_MESSAGE(MESSAGE) _test->error_message = MESSAGE - -#define KPL_FAIL(MESSAGE) do { _KPL_TEST_FAIL_LINE; _KPL_TEST_FAIL_MESSAGE(MESSAGE); } while (0) - -#define KPL_ASSERT(CONDITION, MESSAGE) do { if (!(CONDITION)) { KPL_FAIL(#CONDITION "; " MESSAGE); } } while (0) +#define KPL_FAIL(MESSAGE) do { \ + _test->error_line_number = __LINE__; \ + _test->error_message = MESSAGE; \ +} while (0) + +#define KPL_ASSERT(CONDITION, MESSAGE) do { \ + if (!(CONDITION)) \ + KPL_FAIL(#CONDITION "; " MESSAGE); \ +} while (0) |
