]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
test: extend util unit test
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 11 Jan 2017 14:29:23 +0000 (15:29 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 12 Jan 2017 15:34:28 +0000 (16:34 +0100)
test/unit/util.c

index 4637e7e1eb8e0a6532e9a3ec62b5fc3a36a79175..5cd9baddd5d2c78a95f72c4c96c92e95ba0a621f 100644 (file)
@@ -74,6 +74,14 @@ void test_unit(void) {
   TEST_CHECK(!UTI_IsZeroTimespec(&ts));
   TEST_CHECK(!UTI_IsZeroNtp64(&ntp_ts));
 
+  ntp_ts.hi = 0;
+  ntp_ts.lo = 0;
+
+  UTI_Ntp64ToTimespec(&ntp_ts, &ts);
+  TEST_CHECK(UTI_IsZeroTimespec(&ts));
+  UTI_TimespecToNtp64(&ts, &ntp_ts, NULL);
+  TEST_CHECK(UTI_IsZeroNtp64(&ntp_ts));
+
   ntp_fuzz.hi = htonl(1);
   ntp_fuzz.lo = htonl(3);
   ntp_ts.hi = htonl(1);