qt5base-lts/tests/auto/corelib/time
Edward Welbourne 964f91fd25 Make POSIX transition rule parser more robust
The POSIX rule parser used by QTzTimeZonePrivate recklessly assumed
that, if splitting the rule on a dot produced more than one part, it
necessarily produced at least three. That's true for well-formed POSIX
rules, but we should catch the case of malformed rules.

Likewise, when calculating the dates of transitions, splitting the
date rule on dots might produce too few fragments; and the fragments
might not parse as valid numbers, or might be out of range for their
respective fields in a date. Check all these cases, too.

Added a test that crashed previously. Changed
QTimeZone::offsetFromUtc() so that its "return zero on invalid"
applies also to the case where the backend returns invalid, in
support of this.

Fixes: QTBUG-92808
Pick-to: 6.1 6.1.0 6.0 5.15
Change-Id: Ica383a7a987465483341bdef8dcfd42edb6b43d6
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2021-04-14 12:57:30 +02:00
..
qcalendar Remove the qmake project files 2021-01-07 15:32:28 +01:00
qdate Make QDate's text round-trip test do actual comparisons 2021-02-11 11:46:04 +01:00
qdatetime Add more QDateTime test-cases close to the epoch 2021-03-05 16:11:26 +01:00
qdatetimeparser Remove the qmake project files 2021-01-07 15:32:28 +01:00
qtime Remove the qmake project files 2021-01-07 15:32:28 +01:00
qtimezone Make POSIX transition rule parser more robust 2021-04-14 12:57:30 +02:00
CMakeLists.txt Add unit tests for qdatetimeparser 2020-10-23 20:33:18 +02:00