]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
test: allow another inaccuracy in util unit test
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 1 Dec 2021 08:26:41 +0000 (09:26 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 1 Dec 2021 08:26:41 +0000 (09:26 +0100)
A 1ns error in UTI_AdjustTimespec() was observed with an i686 build.

test/unit/util.c

index efd9c5a176d04d2dd78ee8eb7f90a7054d18fe8a..112676d23710bdfbbef40686f8bb3a446881f989 100644 (file)
@@ -479,8 +479,8 @@ test_unit(void)
   ts2.tv_nsec = 250000000;
   UTI_AdjustTimespec(&ts, &ts2, &ts3, &x, 2.0, -5.0);
   TEST_CHECK(fabs(x - 6.5) < 1.0e-15);
-  TEST_CHECK(ts3.tv_sec == 10);
-  TEST_CHECK(ts3.tv_nsec == 0);
+  TEST_CHECK((ts3.tv_sec == 10 && ts3.tv_nsec == 0) ||
+             (ts3.tv_sec == 9 && ts3.tv_nsec == 999999999));
 
   for (i = -32; i <= 32; i++) {
     for (j = c = 0; j < 1000; j++) {