summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2023-03-24 12:31:20 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2023-04-20 15:17:26 +0200
commitcb54fa634a380a6e4ed6bd501001eb95b4755435 (patch)
tree9d51015f293aff0b5a0c5fc7f1ca236bb9453ee4 /tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
parent455abef6c659b370bb84dbc686373f830198a330 (diff)
Expand range of allowed UTC offsets to 16 hours
It turns out that Alaska and The Philippines had historical offsets exceeding 15 hours, prior to day-transitions to bring their dates in sync with their respective sides of the international date line. Change-Id: I48fdf3aa6d8c0bacb368d08316733a10ee11a281 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp')
-rw-r--r--tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
index b63e506ad2..da1d3b4e76 100644
--- a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
+++ b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
@@ -507,7 +507,7 @@ void tst_QTimeZone::asBackendZone()
void tst_QTimeZone::systemZone()
{
const QTimeZone zone = QTimeZone::systemTimeZone();
- QVERIFY(zone.isValid());
+ QVERIFY2(zone.isValid(), "Invalid system zone setting, tests are doomed.");
QCOMPARE(zone.id(), QTimeZone::systemTimeZoneId());
QCOMPARE(zone, QTimeZone(QTimeZone::systemTimeZoneId()));
// Check it behaves the same as local-time:
@@ -1162,9 +1162,9 @@ void tst_QTimeZone::utcTest()
QCOMPARE(tz.standardTimeOffset(now), 36000);
QCOMPARE(tz.daylightTimeOffset(now), 0);
- // Test invalid UTC offset, must be in range -14 to +14 hours
- int min = -14*60*60;
- int max = 14*60*60;
+ // Test validity range of UTC offsets:
+ int min = int(QTimeZone::MinUtcOffsetSecs);
+ int max = int(QTimeZone::MaxUtcOffsetSecs);
QCOMPARE(QTimeZone(min - 1).isValid(), false);
QCOMPARE(QTimeZone(min).isValid(), true);
QCOMPARE(QTimeZone(min + 1).isValid(), true);