From: Miroslav Lichvar Date: Wed, 1 Dec 2021 08:26:41 +0000 (+0100) Subject: test: allow another inaccuracy in util unit test X-Git-Tag: 4.2-pre1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c506b9aac8b75c1b8535ff72c69ed32800989bd3;p=thirdparty%2Fchrony.git test: allow another inaccuracy in util unit test A 1ns error in UTI_AdjustTimespec() was observed with an i686 build. --- diff --git a/test/unit/util.c b/test/unit/util.c index efd9c5a1..112676d2 100644 --- a/test/unit/util.c +++ b/test/unit/util.c @@ -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++) {