testing/drivertest:fix variable may be negative

Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
This commit is contained in:
yangguangcai 2023-03-23 21:55:39 +08:00 committed by Xiang Xiao
parent 126faafb6e
commit ffebcfbb9f

View File

@ -258,7 +258,7 @@ static void test_case_timer(FAR void **state)
tim = get_timestamp();
usleep(2 * timer_state->interval);
tim = get_timestamp() - tim;
range = timer_state->interval / 1000 - tim;
range = abs(timer_state->interval / 1000 - tim);
assert_in_range(range, 0, timer_state->range);
}