]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
test: fix sources unit test to call SRC_ReportSource() correctly
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 1 Aug 2022 11:04:00 +0000 (13:04 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 2 Aug 2022 12:44:05 +0000 (14:44 +0200)
Call the function with current time instead of latest sample of the
first source to avoid undefined conversion of negative double to long
int.

Fixes: 07600cbd714f ("test: extend sources unit test")
test/unit/sources.c

index 23986b698f3f49fc75d72c97cd2359f4f3ec64d3..f2770a5a6624bb7aba92105f288d18ac35559144 100644 (file)
@@ -190,6 +190,7 @@ test_unit(void)
     }
 
     for (j = 0; j < sizeof (srcs) / sizeof (srcs[0]); j++) {
+      SCH_GetLastEventTime(&sample.time, NULL, NULL);
       SRC_ReportSource(j, &report, &sample.time);
       SRC_DestroyInstance(srcs[j]);
     }