From 6087bac2963c86280451a0b7df1e82ee2d29d617 Mon Sep 17 00:00:00 2001 From: Yinfang Wang Date: Wed, 6 Jul 2022 17:23:06 +0800 Subject: [PATCH] tests: subsys: edac: move ibecc_cov to new ztest API move ibecc_cov to new ztest API. Signed-off-by: Yinfang Wang --- tests/subsys/edac/ibecc_cov/prj.conf | 1 + tests/subsys/edac/ibecc_cov/src/ibecc.c | 13 +++---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/subsys/edac/ibecc_cov/prj.conf b/tests/subsys/edac/ibecc_cov/prj.conf index 9707ccfa2df..f205f0515e0 100644 --- a/tests/subsys/edac/ibecc_cov/prj.conf +++ b/tests/subsys/edac/ibecc_cov/prj.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_LOG=y +CONFIG_ZTEST_NEW_API=y diff --git a/tests/subsys/edac/ibecc_cov/src/ibecc.c b/tests/subsys/edac/ibecc_cov/src/ibecc.c index 9451a6a1864..b2325711ef0 100644 --- a/tests/subsys/edac/ibecc_cov/src/ibecc.c +++ b/tests/subsys/edac/ibecc_cov/src/ibecc.c @@ -95,7 +95,7 @@ static uint32_t mock_conf_read(pcie_bdf_t bdf, unsigned int reg) /* Include source code to test some static functions */ #include "edac_ibecc.c" -static void test_static_functions(void) +ZTEST(ibecc_cov, test_static_functions) { const struct device *dev = DEVICE_DT_GET(DEVICE_NODE); struct ibecc_error error_data; @@ -134,7 +134,7 @@ static void test_static_functions(void) ibecc_errcmd_setup(PCI_HOST_BRIDGE, false); } -static void test_trigger_nmi_handler(void) +ZTEST(ibecc_cov, test_trigger_nmi_handler) { bool ret; @@ -142,11 +142,4 @@ static void test_trigger_nmi_handler(void) zassert_true(ret, "Test NMI handling"); } -void test_main(void) -{ - ztest_test_suite(ibecc_cov, - ztest_unit_test(test_static_functions), - ztest_unit_test(test_trigger_nmi_handler) - ); - ztest_run_test_suite(ibecc_cov); -} +ZTEST_SUITE(ibecc_cov, NULL, NULL, NULL, NULL, NULL);