tests: unit: rbtree: move testcases to new ZTEST API

Move testcases to the new ZTEST API.

Signed-off-by: NingX Zhao <ningx.zhao@intel.com>
This commit is contained in:
NingX Zhao 2022-08-19 10:07:10 +08:00 committed by Carles Cufí
parent 194cb8abab
commit e57ac68efe
2 changed files with 5 additions and 10 deletions

View file

@ -228,7 +228,7 @@ void test_tree(int size)
}
}
void test_rbtree_spam(void)
ZTEST(rbtree_api, test_rbtree_spam)
{
int size = 1;
@ -255,7 +255,7 @@ void test_rbtree_spam(void)
*
* @see rb_get_min(), rb_get_max()
*/
void test_rb_get_minmax(void)
ZTEST(rbtree_api, test_rb_get_minmax)
{
struct rbnode temp = {0};
@ -277,11 +277,4 @@ void test_rb_get_minmax(void)
zassert_true(rb_get_max(&tree) == &nodes[7], "the tree is invalid");
}
void test_main(void)
{
ztest_test_suite(test_rbtree,
ztest_unit_test(test_rbtree_spam),
ztest_unit_test(test_rb_get_minmax)
);
ztest_run_test_suite(test_rbtree);
}
ZTEST_SUITE(rbtree_api, NULL, NULL, NULL, NULL, NULL);

View file

@ -0,0 +1,2 @@
CONFIG_ZTEST=y
CONFIG_ZTEST_NEW_API=y