From 7039fb1e425016ed60383e3752695edbc28a4201 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 25 Nov 2021 10:46:09 +0100 Subject: Skip QTimeZone::checkOffset() if there are no valid zones to test Change-Id: I62df34fe40b8e89b99912e8ad0d1d2f2f11fd71e Reviewed-by: Andrei Golubev --- tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/auto/corelib') diff --git a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp index 2e433270ef..f68aeced2f 100644 --- a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp +++ b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp @@ -671,6 +671,7 @@ void tst_QTimeZone::checkOffset_data() { "Europe/Kiev", "summer", 2017, 10, 27, 12, 0, 0, 2 * 3600, 3600 }, { "Europe/Kiev", "winter", 2017, 10, 29, 12, 0, 0, 2 * 3600, 0 } }; + bool lacksRows = true; for (const auto &entry : table) { QTimeZone zone(entry.zone); if (zone.isValid()) { @@ -679,10 +680,13 @@ void tst_QTimeZone::checkOffset_data() << QDateTime(QDate(entry.year, entry.month, entry.day), QTime(entry.hour, entry.min, entry.sec), zone) << entry.dst + entry.std << entry.std << entry.dst; + lacksRows = false; } else { qWarning("Skipping %s@%s test as zone is invalid", entry.zone, entry.nick); } } + if (lacksRows) + QSKIP("No valid zone info found, skipping test"); } void tst_QTimeZone::checkOffset() -- cgit v1.2.3