tests: kernel: timer: fix coverity side expression complaint
Capture the value of the volatile variable outside the assert and use the captured value in the assert. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
276c26b01a
commit
2597df4965
1 changed files with 4 additions and 2 deletions
|
@ -80,9 +80,11 @@ static void test_starve(void)
|
||||||
tag(), -(s32_t)ticks_diff);
|
tag(), -(s32_t)ticks_diff);
|
||||||
last_ticks = ticks;
|
last_ticks = ticks;
|
||||||
|
|
||||||
zassert_equal(na, 0,
|
u32_t na_capture = na;
|
||||||
|
|
||||||
|
zassert_equal(na_capture, 0,
|
||||||
"%sTimer alarm fired: %u\n",
|
"%sTimer alarm fired: %u\n",
|
||||||
na);
|
na_capture);
|
||||||
|
|
||||||
k_timer_start(&tmr, K_MSEC(TIMER_DELAY_ms), K_NO_WAIT);
|
k_timer_start(&tmr, K_MSEC(TIMER_DELAY_ms), K_NO_WAIT);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue