Commit b5679278 authored by Enjia Mai's avatar Enjia Mai Committed by Carles Cufi
Browse files

tests: boards: native_posix: move the test rtc to new ztest API



Migrate the testsuite tests/boards/native_posix/rtc to the
new ztest API.

Signed-off-by: default avatarEnjia Mai <enjia.mai@intel.com>
parent a120af8f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
CONFIG_NATIVE_POSIX_SLOWDOWN_TO_REAL_TIME=y
CONFIG_ZTEST=y
CONFIG_ZTEST_NEW_API=y
+3 −11
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ static char *us_time_to_str(char *dest, uint64_t time)
/**
 * @brief Test native_posix real time control
 */
static void test_realtime(void)
ZTEST(native_realtime, test_realtime)
{
	extern uint64_t get_host_us_time(void);
	uint64_t time;
@@ -143,7 +143,7 @@ static void test_realtime(void)
/**
 * @brief Test native_posix RTC offset functionality
 */
static void test_rtc_offset(void)
ZTEST(native_realtime,  test_rtc_offset)
{
	int offset = 567;
	uint64_t start_rtc_time[2];
@@ -164,12 +164,4 @@ static void test_rtc_offset(void)
	zassert_true(diff == offset, "Offsetting RTC failed\n");
}

void test_main(void)
{
	ztest_test_suite(native_realtime_tests,
		ztest_unit_test(test_realtime),
		ztest_unit_test(test_rtc_offset)
	);

	ztest_run_test_suite(native_realtime_tests);
}
ZTEST_SUITE(native_realtime, NULL, NULL, NULL, NULL, NULL);