]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2830] ntpd doesn't always transfer the correct TAI offset via autokey
authorJuergen Perlinger <perlinger@ntp.org>
Sun, 7 Jun 2015 09:25:17 +0000 (11:25 +0200)
committerJuergen Perlinger <perlinger@ntp.org>
Sun, 7 Jun 2015 09:25:17 +0000 (11:25 +0200)
 - fix test case that got damaged by changes to TAI table limit logic

bk: 55740dfdiFG-t0PXwyaNKY0HXSUfAA

tests/ntpd/leapsec.cpp

index ac5f153e4ba1f0252f06f75a4e72a4d340497c6e..ed15ce6b9e61d056eb5327c822232dc66e0fb04a 100644 (file)
@@ -558,10 +558,14 @@ TEST_F(leapsecTest, ls2009limdata) {
        rc = setup_load_table(leap1, TRUE);
        EXPECT_EQ(1, rc);
 
-       // test on-spot with limited table - does not work if build before 2013!
+       // test on-spot with limited table - this is tricky.
+       // The table used ends 2012; depending on the build date, the 2009 entry
+       // might be included or culled. The resulting TAI offset must be either
+       // 34 or 35 seconds, depending on the build date of the test. 
        rc = leapsec_query(&qr, lsec2009, NULL);
        EXPECT_EQ(FALSE, rc);
-       EXPECT_EQ(35, qr.tai_offs);
+       EXPECT_LE(34, qr.tai_offs);
+       EXPECT_GE(35, qr.tai_offs);
        EXPECT_EQ(0,  qr.tai_diff);
        EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
 }