From eb9814c626b3b82573954979b39d7f88cbbe4d38 Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Mon, 31 Jan 2022 08:42:23 +0100 Subject: [PATCH] testsuite: ztest: Fix concatenation in macro Use UTIL_CAT which resolves input arguments instead of direct preprocessor concatenation. Signed-off-by: Krzysztof Chruscinski --- subsys/testsuite/ztest/include/ztest_test_new.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/subsys/testsuite/ztest/include/ztest_test_new.h b/subsys/testsuite/ztest/include/ztest_test_new.h index c4c18b2c1bf..c4bc5bf230c 100644 --- a/subsys/testsuite/ztest/include/ztest_test_new.h +++ b/subsys/testsuite/ztest/include/ztest_test_new.h @@ -103,14 +103,15 @@ extern struct ztest_suite_node _ztest_suite_node_list_end[]; * @param after_fn The function to call after each unit test in this suite * @param teardown_fn The function to call after running all the tests in this suite */ -#define ZTEST_SUITE(SUITE_NAME, PREDICATE, setup_fn, before_fn, after_fn, teardown_fn) \ - static STRUCT_SECTION_ITERABLE(ztest_suite_node, z_ztest_test_node_ ## SUITE_NAME) = { \ - .name = STRINGIFY(SUITE_NAME), \ - .setup = (setup_fn), \ - .before = (before_fn), \ - .after = (after_fn), \ - .teardown = (teardown_fn), \ - .predicate = PREDICATE, \ +#define ZTEST_SUITE(SUITE_NAME, PREDICATE, setup_fn, before_fn, after_fn, teardown_fn) \ + static STRUCT_SECTION_ITERABLE(ztest_suite_node, \ + UTIL_CAT(z_ztest_test_node_, SUITE_NAME)) = { \ + .name = STRINGIFY(SUITE_NAME), \ + .setup = (setup_fn), \ + .before = (before_fn), \ + .after = (after_fn), \ + .teardown = (teardown_fn), \ + .predicate = PREDICATE, \ } /**