Skip to content

Commit ede90a4

Browse files
committed
tests: custom_lib: port to the new ztest API
Align with the latest upstream API. Signed-off-by: Carles Cufi <[email protected]>
1 parent c7a4292 commit ede90a4

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

tests/lib/custom_lib/prj.conf

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

tests/lib/custom_lib/src/main.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <zephyr/ztest.h>
1616
#include <custom_lib/custom_lib.h>
1717

18-
static void test_get_value(void)
18+
ZTEST(custom_lib, test_get_value)
1919
{
2020
/* Verify standard behavior */
2121
zassert_equal(custom_lib_get_value(INT_MIN), INT_MIN,
@@ -37,11 +37,4 @@ static void test_get_value(void)
3737
"get_value failed input of 0");
3838
}
3939

40-
void test_main(void)
41-
{
42-
ztest_test_suite(lib_custom_lib_test,
43-
ztest_unit_test(test_get_value)
44-
);
45-
46-
ztest_run_test_suite(lib_custom_lib_test);
47-
}
40+
ZTEST_SUITE(custom_lib, NULL, NULL, NULL, NULL, NULL);

0 commit comments

Comments
 (0)