test/oneshot:fix oneshot testcase.

Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
This commit is contained in:
yangguangcai 2023-06-26 18:22:47 +08:00 committed by Xiang Xiao
parent 667d03f184
commit 902a1d7ece

View File

@ -184,9 +184,10 @@ static void test_case_oneshot(FAR void **state)
assert_return_code(ret, OK);
clock_timespec_subtract(&ts, &trigger_before, &timespec_sub);
assert_int_equal(oneshot_state->oneshot.ts.tv_sec,
timespec_sub.tv_sec);
assert_in_range(timespec_sub.tv_nsec, 0, NSEC_PER_MSEC);
assert_in_range(timespec_sub.tv_sec,
oneshot_state->oneshot.ts.tv_sec - 1,
oneshot_state->oneshot.ts.tv_sec);
assert_in_range(timespec_sub.tv_nsec, 0, NSEC_PER_SEC);
}
ret = ioctl(fd, OSIOC_START, &oneshot_state->oneshot);