Skip to content

Commit ee4feef

Browse files
committed
tests: unit: util: Add test for REVERSE_ARGS
Added test for new macro. Signed-off-by: Krzysztof Chruscinski <[email protected]>
1 parent f911bbc commit ee4feef

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/unit/util/test.inc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,15 @@ static void test_mixing_GET_ARG_and_FOR_EACH(void)
442442
zassert_equal(a[4], 5, NULL);
443443
}
444444

445+
static void test_REVERSE_ARGS(void)
446+
{
447+
int y[] = {REVERSE_ARGS(1, 2, 3)};
448+
449+
zassert_equal(y[0], 3, NULL);
450+
zassert_equal(y[1], 2, NULL);
451+
zassert_equal(y[2], 1, NULL);
452+
}
453+
445454
#if __cplusplus
446455
extern "C" void test_cxx(void);
447456
void test_cxx(void)
@@ -470,7 +479,8 @@ void test_cc(void)
470479
ztest_unit_test(test_nested_FOR_EACH),
471480
ztest_unit_test(test_GET_ARG_N),
472481
ztest_unit_test(test_GET_ARGS_LESS_N),
473-
ztest_unit_test(test_mixing_GET_ARG_and_FOR_EACH)
482+
ztest_unit_test(test_mixing_GET_ARG_and_FOR_EACH),
483+
ztest_unit_test(test_REVERSE_ARGS)
474484
);
475485

476486
ztest_run_test_suite(test_lib_sys_util_tests);

0 commit comments

Comments
 (0)