Skip to content
Permalink
Browse files

tests/cmsis_rtos_v1: relax timing check a bit

Commit  33c64c2 ("tests/cmsis_rtos_v1: Correct timing assumptions")
introduced a stricter criteria where time spent has to match the clock
within 1% discrepancy. It is zassert_true(diff < max && diff > min)
meaning _less than_ 1%.

The test uses a 1-second delay. When SYS_CLOCK_TICKS_PER_SEC=100 that
means a single tick discrepancy would overflow the test.

Let's be inclusive and allow up to 1% instead. That allows for this
test to pass on m2gl025_miv when using 100 ticks per sec.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
  • Loading branch information...
Nicolas Pitre authored and carlescufi committed Aug 1, 2019
1 parent 1593e52 commit 40aa42eef42ffc93b7496971dee16afdd9d01dbb
Showing with 1 addition and 1 deletion.
  1. +1 −1 tests/cmsis_rtos_v1/src/kernel_apis.c
@@ -55,7 +55,7 @@ void test_kernel_systick(void)
max = WAIT_TIME_US + (WAIT_TIME_US / 100);
min = WAIT_TIME_US - (WAIT_TIME_US / 100);

zassert_true(diff < max && diff > min,
zassert_true(diff <= max && diff >= min,
"start %d stop %d (diff %d) wait %d\n",
start_time, stop_time, diff, WAIT_TIME_US);
}

0 comments on commit 40aa42e

Please sign in to comment.
You can’t perform that action at this time.