Skip to content

Commit

Permalink
tests: subsys: pm: move power_states_api to new ztest API
Browse files Browse the repository at this point in the history
move power_states_api to new ztest API.

Signed-off-by: Yinfang Wang <[email protected]>
  • Loading branch information
yinfangw authored and fabiobaltieri committed Aug 15, 2022
1 parent d8384f9 commit 473649a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions tests/subsys/pm/power_states_api/prj.conf
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
CONFIG_ZTEST=y
CONFIG_ZTEST_NEW_API=y
10 changes: 3 additions & 7 deletions tests/subsys/pm/power_states_api/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static enum pm_state states[] = {PM_STATE_SUSPEND_TO_IDLE,
static enum pm_state wrong_states[] = {PM_STATE_SUSPEND_TO_DISK,
PM_STATE_SUSPEND_TO_RAM, PM_STATE_SUSPEND_TO_RAM};

void test_power_states(void)
ZTEST(power_states_1cpu, test_power_states)
{
enum pm_state dts_states[] =
PM_STATE_LIST_FROM_DT_CPU(DT_NODELABEL(power_states));
Expand All @@ -38,9 +38,5 @@ void test_power_states(void)
"Invalid pm-states array");
}

void test_main(void)
{
ztest_test_suite(power_states_test,
ztest_1cpu_unit_test(test_power_states));
ztest_run_test_suite(power_states_test);
}
ZTEST_SUITE(power_states_1cpu, NULL, NULL, ztest_simple_1cpu_before,
ztest_simple_1cpu_after, NULL);

0 comments on commit 473649a

Please sign in to comment.