From cd1a666e1bee6ce0e14278106e2f937430ada91c Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 1 Aug 2022 13:04:00 +0200 Subject: [PATCH] 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") --- test/unit/sources.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/unit/sources.c b/test/unit/sources.c index 23986b6..f2770a5 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]); }