From 3c7387050c098caf44ffea425b63a97f4251bb46 Mon Sep 17 00:00:00 2001 From: Hu Zhenyu Date: Mon, 4 Jul 2022 13:50:51 +0800 Subject: [PATCH] test: Update the new ZTEST APIs tests/net/mgmt TEST=twister -T tests/net/mgmt # Only build Signed-off-by: Hu Zhenyu --- tests/net/mgmt/prj.conf | 1 + tests/net/mgmt/src/mgmt.c | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/net/mgmt/prj.conf b/tests/net/mgmt/prj.conf index 3d41dd4d85..90ecd17868 100644 --- a/tests/net/mgmt/prj.conf +++ b/tests/net/mgmt/prj.conf @@ -18,3 +18,4 @@ CONFIG_NET_IPV6=y CONFIG_NET_L2_DUMMY=y CONFIG_NET_L2_ETHERNET=n CONFIG_ZTEST=y +CONFIG_ZTEST_NEW_API=y diff --git a/tests/net/mgmt/src/mgmt.c b/tests/net/mgmt/src/mgmt.c index 9ac61da7c3..73122da1f7 100644 --- a/tests/net/mgmt/src/mgmt.c +++ b/tests/net/mgmt/src/mgmt.c @@ -309,7 +309,7 @@ static bool _iface_ip6_del(void) return false; } -void test_mgmt(void) +ZTEST(mgmt_fn_test_suite, test_mgmt) { TC_PRINT("Starting Network Management API test\n"); @@ -354,8 +354,4 @@ void test_mgmt(void) "test_synchronous_event_listener failed"); } -void test_main(void) -{ - ztest_test_suite(test_mgmt_fn, ztest_unit_test(test_mgmt)); - ztest_run_test_suite(test_mgmt_fn); -} +ZTEST_SUITE(mgmt_fn_test_suite, NULL, NULL, NULL, NULL, NULL);