tests: custom_lib: port to the new ztest API

Align with the latest upstream API.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
Carles Cufi 2022-11-19 15:46:46 +01:00 committed by Carles Cufí
parent c7a42920d8
commit ede90a457c
2 changed files with 3 additions and 9 deletions

View file

@ -1,2 +1,3 @@
CONFIG_ZTEST=y
CONFIG_ZTEST_NEW_API=y
CONFIG_CUSTOM_LIB=y

View file

@ -15,7 +15,7 @@
#include <zephyr/ztest.h>
#include <custom_lib/custom_lib.h>
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);