Skip to content

Commit 57a893d

Browse files
nordic-krchnashif
authored andcommitted
testsuite: ztest: Use STRINGIFY in ZTEST_SUITE
Using macro which will resolve complex SUITE_NAME. Without it wrong name was assigned when SUITE_NAME was consists of concatenated defines. Signed-off-by: Krzysztof Chruscinski <[email protected]>
1 parent 50c7c7b commit 57a893d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

subsys/testsuite/ztest/include/ztest_test_new.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ extern struct ztest_suite_node _ztest_suite_node_list_end[];
103103
* @param after_fn The function to call after each unit test in this suite
104104
* @param teardown_fn The function to call after running all the tests in this suite
105105
*/
106-
#define ZTEST_SUITE(SUITE_NAME, PREDICATE, setup_fn, before_fn, after_fn, teardown_fn) \
107-
static STRUCT_SECTION_ITERABLE(ztest_suite_node, z_ztest_test_node_##SUITE_NAME) = { \
108-
.name = #SUITE_NAME, \
109-
.setup = (setup_fn), \
110-
.before = (before_fn), \
111-
.after = (after_fn), \
112-
.teardown = (teardown_fn), \
113-
.predicate = PREDICATE, \
106+
#define ZTEST_SUITE(SUITE_NAME, PREDICATE, setup_fn, before_fn, after_fn, teardown_fn) \
107+
static STRUCT_SECTION_ITERABLE(ztest_suite_node, z_ztest_test_node_ ## SUITE_NAME) = { \
108+
.name = STRINGIFY(SUITE_NAME), \
109+
.setup = (setup_fn), \
110+
.before = (before_fn), \
111+
.after = (after_fn), \
112+
.teardown = (teardown_fn), \
113+
.predicate = PREDICATE, \
114114
}
115115

116116
/**

0 commit comments

Comments
 (0)