From 0754141de950b688198f13e755ff9999d4ee005d Mon Sep 17 00:00:00 2001 From: li biao Date: Fri, 8 Jul 2022 16:07:18 +0800 Subject: [PATCH] tests: lib: newlib: move heap_listener to new ztest API Move test heap_listener to use new ztest API. Signed-off-by: li biao --- tests/lib/newlib/heap_listener/prj.conf | 1 + tests/lib/newlib/heap_listener/src/main.c | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/lib/newlib/heap_listener/prj.conf b/tests/lib/newlib/heap_listener/prj.conf index 7282777ff1..8d8ebf99ba 100644 --- a/tests/lib/newlib/heap_listener/prj.conf +++ b/tests/lib/newlib/heap_listener/prj.conf @@ -2,3 +2,4 @@ CONFIG_ZTEST=y CONFIG_NEWLIB_LIBC=y CONFIG_NEWLIB_LIBC_NANO=n CONFIG_NEWLIB_LIBC_HEAP_LISTENER=y +CONFIG_ZTEST_NEW_API=y diff --git a/tests/lib/newlib/heap_listener/src/main.c b/tests/lib/newlib/heap_listener/src/main.c index 9720ab411c..47bcdf6568 100644 --- a/tests/lib/newlib/heap_listener/src/main.c +++ b/tests/lib/newlib/heap_listener/src/main.c @@ -44,7 +44,7 @@ void *ptr; * and verifies that the heap listener is notified of allocating or returning * memory from the system. */ -void test_alloc_and_trim(void) +ZTEST(newlib_libc_heap_listener, test_alloc_and_trim) { uintptr_t saved_heap_end; @@ -77,10 +77,4 @@ void test_alloc_and_trim(void) heap_listener_unregister(&listener); } -void test_main(void) -{ - ztest_test_suite(newlib_libc_heap_listener, - ztest_unit_test(test_alloc_and_trim)); - - ztest_run_test_suite(newlib_libc_heap_listener); -} +ZTEST_SUITE(newlib_libc_heap_listener, NULL, NULL, NULL, NULL, NULL);