tests: ztress: convert to new ztest API
Move to new ztest API.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
diff --git a/tests/ztest/ztress/prj.conf b/tests/ztest/ztress/prj.conf
index 219719d..7a560bc 100644
--- a/tests/ztest/ztress/prj.conf
+++ b/tests/ztest/ztress/prj.conf
@@ -1,4 +1,5 @@
CONFIG_ZTEST=y
+CONFIG_ZTEST_NEW_API=y
CONFIG_ZTRESS=y
CONFIG_ZTRESS_MAX_THREADS=3
CONFIG_TEST_EXTRA_STACK_SIZE=2048
diff --git a/tests/ztest/ztress/src/main.c b/tests/ztest/ztress/src/main.c
index 8c9e0d4..1e7f871 100644
--- a/tests/ztest/ztress/src/main.c
+++ b/tests/ztest/ztress/src/main.c
@@ -23,7 +23,7 @@
return true;
}
-static void test_timeout(void)
+ZTEST(ztress, test_timeout)
{
int64_t d;
uint32_t repeat = 1000000;
@@ -64,7 +64,7 @@
ztress_abort();
}
-static void test_abort(void)
+ZTEST(ztress, test_abort)
{
struct k_timer timer;
uint32_t repeat = 10000000;
@@ -79,7 +79,7 @@
zassert_true(ztress_exec_count(1) < repeat);
}
-static void test_repeat_completion(void)
+ZTEST(ztress, test_repeat_completion)
{
uint32_t repeat = 10;
@@ -105,7 +105,7 @@
}
}
-static void test_no_context_requirements(void)
+ZTEST(ztress, test_no_context_requirements)
{
uint32_t repeat = 10;
@@ -130,7 +130,7 @@
zassert_true(exec_cnt >= repeat && exec_cnt < repeat + 10);
}
-static void test_too_many_threads(void)
+ZTEST(ztress, test_too_many_threads)
{
uint32_t repeat = 10;
k_timeout_t t = Z_TIMEOUT_TICKS(20);
@@ -151,16 +151,4 @@
zassert_equal(err, -EINVAL, "ztress_execute: unexpected err=%d (expected -EINVAL)", err);
}
-
-void test_main(void)
-{
- ztest_test_suite(ztress_tests,
- ztest_unit_test(test_timeout),
- ztest_unit_test(test_abort),
- ztest_unit_test(test_repeat_completion),
- ztest_unit_test(test_no_context_requirements),
- ztest_unit_test(test_too_many_threads)
- );
-
- ztest_run_test_suite(ztress_tests);
-}
+ZTEST_SUITE(ztress, NULL, NULL, NULL, NULL, NULL);