timeout_tests: do not call sleep from test thread

This is up to scheduler to call sleep when threads are inactive.
So the thread should simply wait for the semaphore for ever (or test timeout).
pull/10698/head
Laurent Meunier 2019-05-17 16:30:01 +02:00
parent 9cc1caa031
commit 19b843d530
1 changed files with 2 additions and 6 deletions

View File

@ -264,9 +264,7 @@ void test_sleep(void)
bool deep_sleep_allowed = sleep_manager_can_deep_sleep_test_check(); bool deep_sleep_allowed = sleep_manager_can_deep_sleep_test_check();
TEST_ASSERT_FALSE_MESSAGE(deep_sleep_allowed, "Deep sleep should be disallowed"); TEST_ASSERT_FALSE_MESSAGE(deep_sleep_allowed, "Deep sleep should be disallowed");
while (!sem.try_acquire()) { sem.acquire();
sleep();
}
timer.stop(); timer.stop();
sleep_manager_unlock_deep_sleep(); sleep_manager_unlock_deep_sleep();
@ -323,9 +321,7 @@ void test_deepsleep(void)
bool deep_sleep_allowed = sleep_manager_can_deep_sleep_test_check(); bool deep_sleep_allowed = sleep_manager_can_deep_sleep_test_check();
TEST_ASSERT_TRUE_MESSAGE(deep_sleep_allowed, "Deep sleep should be allowed"); TEST_ASSERT_TRUE_MESSAGE(deep_sleep_allowed, "Deep sleep should be allowed");
while (!sem.try_acquire()) { sem.acquire();
sleep();
}
timer.stop(); timer.stop();
TEST_ASSERT_UINT64_WITHIN(delta_us, delay_us, timer.read_high_resolution_us()); TEST_ASSERT_UINT64_WITHIN(delta_us, delay_us, timer.read_high_resolution_us());