diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-04-19 13:40:05 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-04-20 21:33:00 +0200 |
commit | 605ae629441d5c00f2c9de7080f5c25558d69acb (patch) | |
tree | a8e984f2ca5656452ba09cdb6e9f4eb551df6f63 /tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp | |
parent | 8e4546b42f699c915d9b3049f86e59f1435c4fc7 (diff) |
Correct the range of allowed hours for a POSIX rule's transition
A POSIX rule's transition time is allowed an hour in the range from
-137 to 137; in particular, a negative hour is allowed, and used by
some Greenland zones using Europe's time-of-transition which, as they
are more than two hours west of Greenwich, happens before midnight.
This means the time of transition can't be represented by a QTime(),
so propagate the int that represents it to the code that consumes it;
and treat parsing failure as an error rather than "correcting" it - if
the transition time is given, it must be valid.
Changed tst_QTimeZone::isTimeZoneIdAvailable()'s verification of
validity to report the name of the zone it thought was invalid.
(A later change, validating POSIX rules, caued this to fail for
America/Nuuk without the present fix.)
Change-Id: I5c9127ac34d878554dd0aca1c1c7338c7e0e1c28
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.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp index 13300cee68..2e197cca4a 100644 --- a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp +++ b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp @@ -405,7 +405,7 @@ void tst_QTimeZone::isTimeZoneIdAvailable() const QList<QByteArray> available = QTimeZone::availableTimeZoneIds(); for (const QByteArray &id : available) { QVERIFY(QTimeZone::isTimeZoneIdAvailable(id)); - QVERIFY(QTimeZone(id).isValid()); + QVERIFY2(QTimeZone(id).isValid(), id); } } |