Skip to content

Commit

Permalink
fix comments issues
Browse files Browse the repository at this point in the history
Signed-off-by: Jerry Yu <[email protected]>
  • Loading branch information
yuhaoth committed Apr 17, 2023
1 parent c9c3e62 commit 398386d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/suites/test_suite_platform.function
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ void time_delay_seconds(int delay_secs)
elapsed_secs = mbedtls_time(NULL) - current;

/* 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.
* Epoch. That is affected by discontinuous jumps. And `nanosleep` use
* CLOCK_MONOTONIC(monotonically-increasing time source), That will cause
* negative elapsed time difference.
*
* Workaround it with 1 seconds tolerance.
*/
TEST_ASSERT(elapsed_secs >= delay_secs - 1);
TEST_ASSERT(elapsed_secs < 4 + delay_secs);
Expand Down

0 comments on commit 398386d

Please sign in to comment.