mirror of
https://github.com/cuberite/polarssl.git
synced 2025-10-04 11:09:00 -04:00
workaround the assert fail with tollerance
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
parent
fce8577f73
commit
c9c3e62b3e
@ -84,7 +84,12 @@ void time_delay_seconds(int delay_secs)
|
|||||||
sleep_ms(delay_secs * 1000);
|
sleep_ms(delay_secs * 1000);
|
||||||
|
|
||||||
elapsed_secs = mbedtls_time(NULL) - current;
|
elapsed_secs = mbedtls_time(NULL) - current;
|
||||||
TEST_ASSERT(elapsed_secs >= delay_secs);
|
|
||||||
|
/* Built-in mbedtls_time function returns the number of seconds since the
|
||||||
|
* Epoch. That is affected by discontinuous jumps and cause test fail.
|
||||||
|
* Workaround it with 1 seconds tollerance.
|
||||||
|
*/
|
||||||
|
TEST_ASSERT(elapsed_secs >= delay_secs - 1);
|
||||||
TEST_ASSERT(elapsed_secs < 4 + delay_secs);
|
TEST_ASSERT(elapsed_secs < 4 + delay_secs);
|
||||||
/* This goto is added to avoid warnings from the generated code. */
|
/* This goto is added to avoid warnings from the generated code. */
|
||||||
goto exit;
|
goto exit;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user