tests/kernel: Cast time difference to int32_t before abs call
Clang complains when an unsigned value is passed to abs, even though there is an implicit cast to a signed type. Insert an explicit cast to make clang happy. Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
3f3224d880
commit
95a5c60abf
|
@ -239,7 +239,7 @@ static void _test_kernel_cpu_idle(int atomic)
|
|||
k_cpu_idle();
|
||||
}
|
||||
dt = k_uptime_ticks() - t0;
|
||||
zassert_true(abs(dt - dur) <= slop,
|
||||
zassert_true(abs((int32_t) (dt - dur)) <= slop,
|
||||
"Inaccurate wakeup, idled for %d ticks, expected %d",
|
||||
dt, dur);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue