From 63cc458fc3d0df10c91ca5c859a656845d27a8ad Mon Sep 17 00:00:00 2001 From: nodist Date: Wed, 16 Sep 2026 14:52:09 -0400 Subject: run test by matching string --- include/kpl_test.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'include') 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) -- cgit v1.2.3