Skip to content

Commit 02ad698

Browse files
Chen Peng1nashif
authored andcommitted
tests: iterable_sections: move to new ztest API.
Move test iterable_sections to use new ztest API. Signed-off-by: Chen Peng1 <[email protected]>
1 parent aca68ae commit 02ad698

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

tests/misc/iterable_sections/prj.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
CONFIG_ZTEST=y
2+
CONFIG_ZTEST_NEW_API=y

tests/misc/iterable_sections/src/main.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ STRUCT_SECTION_ITERABLE(test_ram, ram1) = {0x01};
2525
* @brief Test iterable in read write section.
2626
*
2727
*/
28-
void test_ram(void)
28+
ZTEST(iterable_sections, test_ram)
2929
{
3030
int out = 0;
3131

@@ -63,7 +63,7 @@ STRUCT_SECTION_ITERABLE(test_rom, rom2) = {0x20};
6363
* @brief Test iterable in read only section.
6464
*
6565
*/
66-
void test_rom(void)
66+
ZTEST(iterable_sections, test_rom)
6767
{
6868
int out = 0;
6969

@@ -74,15 +74,4 @@ void test_rom(void)
7474
zassert_equal(out, ROM_EXPECT, "Check value incorrect (got: 0x%x)", out);
7575
}
7676

77-
/**
78-
*
79-
* @brief Test entry point
80-
*
81-
*/
82-
void test_main(void)
83-
{
84-
ztest_test_suite(iterable_sections,
85-
ztest_unit_test(test_ram),
86-
ztest_unit_test(test_rom));
87-
ztest_run_test_suite(iterable_sections);
88-
}
77+
ZTEST_SUITE(iterable_sections, NULL, NULL, NULL, NULL, NULL);

0 commit comments

Comments
 (0)