From: Miroslav Lichvar Date: Mon, 1 Aug 2022 11:04:00 +0000 (+0200) Subject: test: fix sources unit test to call SRC_ReportSource() correctly X-Git-Tag: 4.3-pre1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd1a666e1bee6ce0e14278106e2f937430ada91c;p=thirdparty%2Fchrony.git test: fix sources unit test to call SRC_ReportSource() correctly 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") --- diff --git a/test/unit/sources.c b/test/unit/sources.c index 23986b69..f2770a5a 100644 --- a/test/unit/sources.c +++ b/test/unit/sources.c @@ -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]); }