diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2023-03-28 11:21:31 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2023-04-28 16:13:25 +0200 |
commit | 5dabac2c9cf902c153e2b2e9e4d3e7077e674a7e (patch) | |
tree | 507adb2e87f04116bf0e43d837edb964c5fc815b /tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp | |
parent | 127e33d4c6e000ed1fab0f2ea926918ed0bf3bd3 (diff) |
Change QTimeZone's offset range into constants, not an enum
Use static constexpr int values instead of abusing enum.
[ChangeLog][QtCore][QTimeZone] The MinUtcOffsetSecs and
MaxUtcOffsetSecs constants are now static constexpr members of
QTimeZone, rather than members of an anonymous enum. Their values are
now 16 hours either side of zero, to allow for some historical zones.
Change-Id: I1c3a0f85a2b83b5010f021ca0f5ca5baefbf32e4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp')
-rw-r--r-- | tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp index da1d3b4e76..ea52033723 100644 --- a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp +++ b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp @@ -1163,8 +1163,8 @@ void tst_QTimeZone::utcTest() QCOMPARE(tz.daylightTimeOffset(now), 0); // Test validity range of UTC offsets: - int min = int(QTimeZone::MinUtcOffsetSecs); - int max = int(QTimeZone::MaxUtcOffsetSecs); + int min = QTimeZone::MinUtcOffsetSecs; + int max = QTimeZone::MaxUtcOffsetSecs; QCOMPARE(QTimeZone(min - 1).isValid(), false); QCOMPARE(QTimeZone(min).isValid(), true); QCOMPARE(QTimeZone(min + 1).isValid(), true); |