You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/08/09 10:22:05 UTC
[nuttx-apps] 04/04: test/oneshot:fix oneshot testcase.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit 902a1d7ece2bb07c4bfc5a7f8a08acf70eb31e2e
Author: yangguangcai <ya...@xiaomi.com>
AuthorDate: Mon Jun 26 18:22:47 2023 +0800
test/oneshot:fix oneshot testcase.
Signed-off-by: yangguangcai <ya...@xiaomi.com>
---
testing/drivertest/drivertest_oneshot.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/testing/drivertest/drivertest_oneshot.c b/testing/drivertest/drivertest_oneshot.c
index 329d0477d..a86213840 100644
--- a/testing/drivertest/drivertest_oneshot.c
+++ b/testing/drivertest/drivertest_oneshot.c
@@ -184,9 +184,10 @@ static void test_case_oneshot(FAR void **state)
assert_return_code(ret, OK);
clock_timespec_subtract(&ts, &trigger_before, ×pec_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);