mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #10698 from LMESTM/Timeout_test_do_not_call_sleep_from_thread
timeout_tests: do not call sleep from test threadpull/10755/head
commit
0ebf9617c4
|
@ -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());
|
||||||
|
|
Loading…
Reference in New Issue