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:
parent
94078d3d8f
commit
0754141de9
|
@ -2,3 +2,4 @@ CONFIG_ZTEST=y
|
||||||
CONFIG_NEWLIB_LIBC=y
|
CONFIG_NEWLIB_LIBC=y
|
||||||
CONFIG_NEWLIB_LIBC_NANO=n
|
CONFIG_NEWLIB_LIBC_NANO=n
|
||||||
CONFIG_NEWLIB_LIBC_HEAP_LISTENER=y
|
CONFIG_NEWLIB_LIBC_HEAP_LISTENER=y
|
||||||
|
CONFIG_ZTEST_NEW_API=y
|
||||||
|
|
|
@ -44,7 +44,7 @@ void *ptr;
|
||||||
* and verifies that the heap listener is notified of allocating or returning
|
* and verifies that the heap listener is notified of allocating or returning
|
||||||
* memory from the system.
|
* memory from the system.
|
||||||
*/
|
*/
|
||||||
void test_alloc_and_trim(void)
|
ZTEST(newlib_libc_heap_listener, test_alloc_and_trim)
|
||||||
{
|
{
|
||||||
uintptr_t saved_heap_end;
|
uintptr_t saved_heap_end;
|
||||||
|
|
||||||
|
@ -77,10 +77,4 @@ void test_alloc_and_trim(void)
|
||||||
heap_listener_unregister(&listener);
|
heap_listener_unregister(&listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_main(void)
|
ZTEST_SUITE(newlib_libc_heap_listener, NULL, NULL, NULL, NULL, NULL);
|
||||||
{
|
|
||||||
ztest_test_suite(newlib_libc_heap_listener,
|
|
||||||
ztest_unit_test(test_alloc_and_trim));
|
|
||||||
|
|
||||||
ztest_run_test_suite(newlib_libc_heap_listener);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue