From d6c18cb6e657351b567798be79b317e12fd4d2de Mon Sep 17 00:00:00 2001 From: Jan Mohr Date: Thu, 26 Oct 2023 10:40:43 +0200 Subject: [PATCH] tests/pkg/minmea: fixing RMC timestamp --- tests/pkg/minmea/main.c | 8 +++++++- tests/pkg/minmea/tests/01-run.py | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/pkg/minmea/main.c b/tests/pkg/minmea/main.c index 8ab72545f81e9..781d99b3c9c3c 100644 --- a/tests/pkg/minmea/main.c +++ b/tests/pkg/minmea/main.c @@ -111,6 +111,9 @@ int _parse_nmea_msg(const char* nmea_msg) time_t timestamp; minmea_getdatetime(&tm, &frame.date, &frame.time); timestamp = mktime(&tm); + /* timestamp is dependent on given EPOCH time */ + /* just as an example on how you would create the timestamp */ + (void) timestamp; /* print values */ print_str("\tlat: "); @@ -119,7 +122,10 @@ int _parse_nmea_msg(const char* nmea_msg) print_str("\tlon: "); print_float(minmea_tocoord(&frame.longitude), 6); printf("\n"); - printf("\ttime: %"PRIu32"\n", (uint32_t)timestamp); + /* timestamp not used here, dependent on time zone (make test can fail) */ + printf("\tdate: %d.%d.%d\n", frame.date.day, frame.date.month, frame.date.year); + printf("\ttime: %dh %dm %ds, %dms\n", frame.time.hours, frame.time.minutes, + frame.time.seconds, frame.time.microseconds/1000); } else { puts("check_nmea: invalid RMC record"); diff --git a/tests/pkg/minmea/tests/01-run.py b/tests/pkg/minmea/tests/01-run.py index 6b91ac437a6d6..d09db2414c671 100755 --- a/tests/pkg/minmea/tests/01-run.py +++ b/tests/pkg/minmea/tests/01-run.py @@ -32,7 +32,8 @@ def testfunc(child): child.expect_exact('check_nmea: RMC recorded\r\n') child.expect_exact('\tlat: 52.450366\r\n') child.expect_exact('\tlon: 13.298649\r\n') - child.expect_exact('\ttime: 1697808102\r\n') + child.expect_exact('\tdate: 20.10.23\r\n') + child.expect_exact('\ttime: 14h 21m 42s, 227ms\r\n') child.expect_exact('SUCCESS\r\n')