From aec0f624eef30690229a6b047fd715efa06e2f43 Mon Sep 17 00:00:00 2001 From: NingX Zhao Date: Fri, 12 Aug 2022 13:16:05 +0800 Subject: [PATCH] tests: kernel: mslab: move concept cases to new ZTEST API Move concept test cases to new ZTEST API. Signed-off-by: NingX Zhao --- tests/kernel/mem_slab/mslab_concept/prj.conf | 1 + tests/kernel/mem_slab/mslab_concept/src/main.c | 9 +-------- .../mem_slab/mslab_concept/src/test_mslab_alloc_wait.c | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/kernel/mem_slab/mslab_concept/prj.conf b/tests/kernel/mem_slab/mslab_concept/prj.conf index 9467c292689..9228251051e 100644 --- a/tests/kernel/mem_slab/mslab_concept/prj.conf +++ b/tests/kernel/mem_slab/mslab_concept/prj.conf @@ -1 +1,2 @@ CONFIG_ZTEST=y +CONFIG_ZTEST_NEW_API=y diff --git a/tests/kernel/mem_slab/mslab_concept/src/main.c b/tests/kernel/mem_slab/mslab_concept/src/main.c index 17741b94ed4..85ebc5ebe31 100644 --- a/tests/kernel/mem_slab/mslab_concept/src/main.c +++ b/tests/kernel/mem_slab/mslab_concept/src/main.c @@ -5,12 +5,5 @@ */ #include -extern void test_mslab_alloc_wait_prio(void); -/*test case main entry*/ -void test_main(void) -{ - ztest_test_suite(mslab_concept, - ztest_1cpu_unit_test(test_mslab_alloc_wait_prio)); - ztest_run_test_suite(mslab_concept); -} +ZTEST_SUITE(mslab_concept, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/kernel/mem_slab/mslab_concept/src/test_mslab_alloc_wait.c b/tests/kernel/mem_slab/mslab_concept/src/test_mslab_alloc_wait.c index 8348b12feea..c1e712b42f6 100644 --- a/tests/kernel/mem_slab/mslab_concept/src/test_mslab_alloc_wait.c +++ b/tests/kernel/mem_slab/mslab_concept/src/test_mslab_alloc_wait.c @@ -48,7 +48,7 @@ void tmslab_alloc_wait_ok(void *p1, void *p2, void *p3) * @see k_mem_slab_alloc() * @see k_mem_slab_free() */ -void test_mslab_alloc_wait_prio(void) +ZTEST(mslab_concept, test_mslab_alloc_wait_prio) { void *block[BLK_NUM]; k_tid_t tid[THREAD_NUM];