mirror of https://github.com/ARMmbed/mbed-os.git
tests-events-timing - print debug info only in case of failure.
In the 'Testing accuracy of equeue semaphore' test case result is printed out in each loop iteration. Since debug prints should not exist in the final test version I suggest to print information only in case of failure. Additionally time needed to print single info is equal to ~25 ms (K64F/GCC_ARM). The while loop is designed to execute until 20000 ms elapses, so this print has also impact on number of times the loop is executed (number of semaphore accuracy checks).pull/6135/head
parent
04f0f2b1aa
commit
2b68eb19e3
|
@ -107,7 +107,10 @@ void semaphore_timing_test() {
|
|||
equeue_sema_wait(&sema, delay);
|
||||
int taken = timer.read_us() - start;
|
||||
|
||||
printf("delay %dms => error %dus\r\n", delay, abs(1000*delay - taken));
|
||||
if (taken < (delay * 1000 - 5000) || taken > (delay * 1000 + 5000)) {
|
||||
printf("delay %dms => error %dus\r\n", delay, abs(1000 * delay - taken));
|
||||
}
|
||||
|
||||
TEST_ASSERT_INT_WITHIN(5000, taken, delay * 1000);
|
||||
|
||||
led = !led;
|
||||
|
|
Loading…
Reference in New Issue