Skip QTimeZone::checkOffset() if there are no valid zones to test

Change-Id: I62df34fe40b8e89b99912e8ad0d1d2f2f11fd71e
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
This commit is contained in:
Edward Welbourne 2021-11-25 10:46:09 +01:00
parent bcc15f36cc
commit 7039fb1e42

View File

@ -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()