tests: unit: move the timeutil test to new ztest API
Migrate the testsuite tests/unit/timeutil to the new ztest API. Signed-off-by: Enjia Mai <enjia.mai@intel.com>
This commit is contained in:
parent
8f87885965
commit
7133f34c1b
6 changed files with 6 additions and 15 deletions
|
@ -52,14 +52,4 @@ void timeutil_check(const struct timeutil_test_data *tp,
|
|||
}
|
||||
}
|
||||
|
||||
/*test case main entry*/
|
||||
void test_main(void)
|
||||
{
|
||||
ztest_test_suite(test_timeutil_api,
|
||||
ztest_unit_test(test_gmtime),
|
||||
ztest_unit_test(test_s32),
|
||||
ztest_unit_test(test_s64),
|
||||
ztest_unit_test(test_sync)
|
||||
);
|
||||
ztest_run_test_suite(test_timeutil_api);
|
||||
}
|
||||
ZTEST_SUITE(timeutil_api, NULL, NULL, NULL, NULL, NULL);
|
||||
|
|
1
tests/unit/timeutil/prj.conf
Normal file
1
tests/unit/timeutil/prj.conf
Normal file
|
@ -0,0 +1 @@
|
|||
CONFIG_ZTEST_NEW_API=y
|
|
@ -10,7 +10,7 @@
|
|||
#include <zephyr/ztest.h>
|
||||
#include "timeutil_test.h"
|
||||
|
||||
void test_gmtime(void)
|
||||
ZTEST(timeutil_api, test_gmtime)
|
||||
{
|
||||
struct tm tm = {
|
||||
/* Initialize an unset field */
|
||||
|
|
|
@ -238,7 +238,7 @@ static const struct timeutil_test_data tests[] = {
|
|||
} },
|
||||
};
|
||||
|
||||
void test_s32(void)
|
||||
ZTEST(timeutil_api, test_s32)
|
||||
{
|
||||
timeutil_check(tests, sizeof(tests) / sizeof(*tests));
|
||||
}
|
||||
|
|
|
@ -323,7 +323,7 @@ static void test_time32_overflow(void)
|
|||
"final errno state bad");
|
||||
}
|
||||
|
||||
void test_s64(void)
|
||||
ZTEST(timeutil_api, test_s64)
|
||||
{
|
||||
if (sizeof(time_t) < 8U) {
|
||||
test_time32_errno_clear();
|
||||
|
|
|
@ -426,7 +426,7 @@ static void test_skew_to_ppb(void)
|
|||
"unexpected above limit: %.10g %d", skew, ppb);
|
||||
}
|
||||
|
||||
void test_sync(void)
|
||||
ZTEST(timeutil_api, test_sync)
|
||||
{
|
||||
test_state_update();
|
||||
test_state_set_skew();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue