From ede90a457c29eb5fe668c91effad7072c6146b4d Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Sat, 19 Nov 2022 15:46:46 +0100 Subject: [PATCH] tests: custom_lib: port to the new ztest API Align with the latest upstream API. Signed-off-by: Carles Cufi --- tests/lib/custom_lib/prj.conf | 1 + tests/lib/custom_lib/src/main.c | 11 ++--------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/lib/custom_lib/prj.conf b/tests/lib/custom_lib/prj.conf index f70c400..b0d275a 100644 --- a/tests/lib/custom_lib/prj.conf +++ b/tests/lib/custom_lib/prj.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y +CONFIG_ZTEST_NEW_API=y CONFIG_CUSTOM_LIB=y diff --git a/tests/lib/custom_lib/src/main.c b/tests/lib/custom_lib/src/main.c index 25477e2..6b3a4b9 100644 --- a/tests/lib/custom_lib/src/main.c +++ b/tests/lib/custom_lib/src/main.c @@ -15,7 +15,7 @@ #include #include -static void test_get_value(void) +ZTEST(custom_lib, test_get_value) { /* Verify standard behavior */ zassert_equal(custom_lib_get_value(INT_MIN), INT_MIN, @@ -37,11 +37,4 @@ static void test_get_value(void) "get_value failed input of 0"); } -void test_main(void) -{ - ztest_test_suite(lib_custom_lib_test, - ztest_unit_test(test_get_value) - ); - - ztest_run_test_suite(lib_custom_lib_test); -} +ZTEST_SUITE(custom_lib, NULL, NULL, NULL, NULL, NULL);