tests: unit: util: Add test for REVERSE_ARGS

Added test for new macro.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2021-02-17 11:34:31 +01:00 committed by Carles Cufí
commit 9d3326586c

View file

@ -442,6 +442,15 @@ static void test_mixing_GET_ARG_and_FOR_EACH(void)
zassert_equal(a[4], 5, NULL);
}
static void test_REVERSE_ARGS(void)
{
int y[] = {REVERSE_ARGS(1, 2, 3)};
zassert_equal(y[0], 3, NULL);
zassert_equal(y[1], 2, NULL);
zassert_equal(y[2], 1, NULL);
}
#if __cplusplus
extern "C" void test_cxx(void);
void test_cxx(void)
@ -470,7 +479,8 @@ void test_cc(void)
ztest_unit_test(test_nested_FOR_EACH),
ztest_unit_test(test_GET_ARG_N),
ztest_unit_test(test_GET_ARGS_LESS_N),
ztest_unit_test(test_mixing_GET_ARG_and_FOR_EACH)
ztest_unit_test(test_mixing_GET_ARG_and_FOR_EACH),
ztest_unit_test(test_REVERSE_ARGS)
);
ztest_run_test_suite(test_lib_sys_util_tests);