mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			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
							parent
							
								
									9cc1caa031
								
							
						
					
					
						commit
						19b843d530
					
				| 
						 | 
				
			
			@ -264,9 +264,7 @@ void test_sleep(void)
 | 
			
		|||
 | 
			
		||||
    bool deep_sleep_allowed = sleep_manager_can_deep_sleep_test_check();
 | 
			
		||||
    TEST_ASSERT_FALSE_MESSAGE(deep_sleep_allowed, "Deep sleep should be disallowed");
 | 
			
		||||
    while (!sem.try_acquire()) {
 | 
			
		||||
        sleep();
 | 
			
		||||
    }
 | 
			
		||||
    sem.acquire();
 | 
			
		||||
    timer.stop();
 | 
			
		||||
 | 
			
		||||
    sleep_manager_unlock_deep_sleep();
 | 
			
		||||
| 
						 | 
				
			
			@ -323,9 +321,7 @@ void test_deepsleep(void)
 | 
			
		|||
 | 
			
		||||
    bool deep_sleep_allowed = sleep_manager_can_deep_sleep_test_check();
 | 
			
		||||
    TEST_ASSERT_TRUE_MESSAGE(deep_sleep_allowed, "Deep sleep should be allowed");
 | 
			
		||||
    while (!sem.try_acquire()) {
 | 
			
		||||
        sleep();
 | 
			
		||||
    }
 | 
			
		||||
    sem.acquire();
 | 
			
		||||
    timer.stop();
 | 
			
		||||
 | 
			
		||||
    TEST_ASSERT_UINT64_WITHIN(delta_us, delay_us, timer.read_high_resolution_us());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue