From 81c9649de3be5a5b0455942e054f89ebd692ab9e Mon Sep 17 00:00:00 2001 From: Jo Date: Sat, 29 Jun 2024 18:38:23 +0200 Subject: [PATCH] Fix developed by Matthias Behr --- src/protocols/MeterOMS.cpp | 2 +- tests/CMakeLists.txt | 2 +- tests/mocks/mock_MeterOMS.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/protocols/MeterOMS.cpp b/src/protocols/MeterOMS.cpp index a84acea8..5cbdd15f 100644 --- a/src/protocols/MeterOMS.cpp +++ b/src/protocols/MeterOMS.cpp @@ -601,7 +601,7 @@ double MeterOMS::get_record_value(mbus_data_record *record) const { t.tm_year = 100 + (((record->data[3] & 0xe0) >> 5) | ((record->data[4] & 0xf0) >> 1)); // tm_year is number of years since 1900. - t.tm_isdst = ((record->data[0] & 0x40) == 0x40) ? 1 : 0; + t.tm_isdst = -1; // We ignore data[0] & 0x40 // check for time invalid at bit 16 (1-based) if ((record->data[1] & 0x80) == 0x80) { // time invalid! diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 77d7fee1..210ad2f2 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -88,7 +88,7 @@ IF(GCOV_PATH AND LCOV_PATH AND GENHTML_PATH) COMMAND vzlogger_unit_tests COMMAND mock_metermap COMMAND mock_MeterW1therm - COMMAND env TZ="Europe/Berlin" mock_MeterOMS + COMMAND mock_MeterOMS COMMAND mock_MeterS0 # Capturing lcov counters and generating report diff --git a/tests/mocks/mock_MeterOMS.cpp b/tests/mocks/mock_MeterOMS.cpp index 666256d2..d673f3d2 100644 --- a/tests/mocks/mock_MeterOMS.cpp +++ b/tests/mocks/mock_MeterOMS.cpp @@ -136,7 +136,7 @@ TEST(mock_MeterOMS, first_packets) { t.tm_mday = 20; t.tm_mon = 6 - 1; t.tm_year = 2015 - 1900; - t.tm_isdst = 1; + t.tm_isdst = -1; ASSERT_EQ(rds[7].time_s(), mktime(&t)); }