Merge pull request #9416 from fkjagodzinski/test_update-systimer

RTOS: SysTimer: Fix test timing issues
pull/9286/head
Martin Kojtal 2019-01-21 13:44:53 +01:00 committed by GitHub
commit a09b5f5c6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -245,7 +245,10 @@ void test_handler_called_once(void)
int32_t sem_slots = st.sem_wait(0);
TEST_ASSERT_EQUAL_INT32(0, sem_slots);
sem_slots = st.sem_wait(osWaitForever);
// Wait in a busy loop to prevent entering sleep or deepsleep modes.
while (sem_slots != 1) {
sem_slots = st.sem_wait(0);
}
us_timestamp_t t2 = st.get_time();
TEST_ASSERT_EQUAL_INT32(1, sem_slots);
TEST_ASSERT_EQUAL_UINT32(1, st.get_tick());