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:
Peter Bigot 2020-01-03 11:08:10 -06:00 committed by Anas Nashif
commit 2597df4965

View file

@ -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);