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 <[email protected]>
AuthorDate: Mon Jun 26 18:22:47 2023 +0800

    test/oneshot:fix oneshot testcase.
    
    Signed-off-by: yangguangcai <[email protected]>
---
 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, &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);

Reply via email to