Commit cb657057 authored by Gerard Marull-Paretas's avatar Gerard Marull-Paretas Committed by Anas Nashif
Browse files

tests: pm: power_mgmt: use PM_STATE_SUSPEND_TO_IDLE



Since the tests expects devices to change states, PM_STATE_RUNTIME_IDLE
can't be used. The first state that cares about devices is
PM_STATE_SUSPEND_TO_IDLE.

Signed-off-by: default avatarGerard Marull-Paretas <gerard.marull@nordicsemi.no>
parent 69996900
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ struct pm_state_info pm_policy_next_state(int ticks)
	if (enter_low_power) {
		enter_low_power = false;
		notify_app_entry = true;
		info.state = PM_STATE_RUNTIME_IDLE;
		info.state = PM_STATE_SUSPEND_TO_IDLE;
	} else {
		/* only test pm_policy_next_state()
		 * no PM operation done
@@ -88,7 +88,7 @@ static void notify_pm_state_entry(enum pm_state state)
	zassert_true(notify_app_entry == true,
		     "Notification to enter suspend was not sent to the App");
	zassert_true(z_is_idle_thread_object(_current), NULL);
	zassert_equal(state, PM_STATE_RUNTIME_IDLE, NULL);
	zassert_equal(state, PM_STATE_SUSPEND_TO_IDLE, NULL);

	/* at this point, devices should not be active */
	pm_device_state_get(dev, &device_power_state);
@@ -106,7 +106,7 @@ static void notify_pm_state_exit(enum pm_state state)
	zassert_true(notify_app_exit == true,
		     "Notification to leave suspend was not sent to the App");
	zassert_true(z_is_idle_thread_object(_current), NULL);
	zassert_equal(state, PM_STATE_RUNTIME_IDLE, NULL);
	zassert_equal(state, PM_STATE_SUSPEND_TO_IDLE, NULL);

	/* at this point, devices are active again*/
	pm_device_state_get(dev, &device_power_state);