Commit 95a5c60a authored by Keith Packard's avatar Keith Packard Committed by Carles Cufi
Browse files

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: default avatarKeith Packard <keithp@keithp.com>
parent 3f3224d8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
	}