test/oneshot:fix oneshot testcase.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
This commit is contained in:
parent
667d03f184
commit
902a1d7ece
@ -184,9 +184,10 @@ static void test_case_oneshot(FAR void **state)
|
|||||||
assert_return_code(ret, OK);
|
assert_return_code(ret, OK);
|
||||||
|
|
||||||
clock_timespec_subtract(&ts, &trigger_before, ×pec_sub);
|
clock_timespec_subtract(&ts, &trigger_before, ×pec_sub);
|
||||||
assert_int_equal(oneshot_state->oneshot.ts.tv_sec,
|
assert_in_range(timespec_sub.tv_sec,
|
||||||
timespec_sub.tv_sec);
|
oneshot_state->oneshot.ts.tv_sec - 1,
|
||||||
assert_in_range(timespec_sub.tv_nsec, 0, NSEC_PER_MSEC);
|
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);
|
ret = ioctl(fd, OSIOC_START, &oneshot_state->oneshot);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user