Skip to content

Commit 38825c0

Browse files
dcpleungmmahadevan108
authored andcommitted
tests: timer_behavior: use fabs() instead of abs()
abs() takes integer as argument but time_diff_us is of double. So use fabs() instead. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
1 parent cc5adf2 commit 38825c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/kernel/timer/timer_behavior/src/jitter_drift.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ static void do_test_using(void (*sample_collection_fn)(void), const char *mechan
333333
"Standard deviation (in microseconds) outside expected bound");
334334

335335
/* Validate the timer drift (accuracy over time) is within a configurable bound */
336-
zassert_true(abs(time_diff_us) < CONFIG_TIMER_TEST_MAX_DRIFT,
336+
zassert_true(fabs(time_diff_us) < CONFIG_TIMER_TEST_MAX_DRIFT,
337337
"Drift (in microseconds) outside expected bound");
338338
}
339339

0 commit comments

Comments
 (0)