tests: lib: newlib: move heap_listener to new ztest API

Move test heap_listener to use new ztest API.

Signed-off-by: li biao <biao1x.li@intel.com>
This commit is contained in:
li biao 2022-07-08 16:07:18 +08:00 committed by Carles Cufí
parent 94078d3d8f
commit 0754141de9
2 changed files with 3 additions and 8 deletions

View File

@ -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

View File

@ -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);