qt5base-lts/tests/auto/corelib/text
Edward Welbourne 9fee35a2ed Fix assertion failure when parsing a doubly-invalid date-time text
When the date-time string falls in a spring-forward (so is invalid)
and one of the fields of the parsed string doesn't match the format
it's meant to (e.g. a single-digit seconds field when format ss was
specified), a check that the current fall-back date-time is between
the minimum and maximum for the parser object failed, triggering an
assertion.

In any case, an invalid default-value wasn't useful to the code that
parsed a single section of the date-time string, so brute-force the
current value to a valid date-time (when possible) using the usual
round-trip via milliseconds since the epoch.

Added the test-case which first revealed the problem, plus a couple
more informed by it, to exercise the same code-paths with fewer things
failing.

Fixes: QTBUG-102199
Pick-to: 6.3 6.2 5.15
Change-Id: I658308614505ef25f4c97d0de6148acb54a65a0f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-07 23:04:04 +02:00
..
qanystringview Replace uses of _qs with _s in tests 2022-04-07 19:30:17 +02:00
qbytearray Add literal operators for QString/QByteArray to StringLiterals namespace 2022-04-07 09:22:28 +02:00
qbytearrayapisymmetry Silence compiler warning 2021-10-06 15:05:20 +02:00
qbytearraylist QByteArrayList: add join(QByteArrayView) 2021-11-04 01:16:16 +01:00
qbytearraymatcher Q(Static)ByteArrayMatcher: manage indexIn() overloads 2022-01-23 09:48:28 +01:00
qbytearrayview tst_QByteArrayView:: disable failing constexpr checks for GCC 2022-04-01 09:51:29 +02:00
qbytedatabuffer Remove the qmake project files 2021-01-07 15:32:28 +01:00
qchar Cleanup tests that add test data to resources explicitly 2022-02-11 21:54:44 +01:00
qcollator Fix tst_qcollator run time issue on INTEGRITY device 2022-01-12 21:49:02 +00:00
qlatin1stringview Allow brace initialization for some of QLatin1StringView constructors 2022-04-01 19:33:12 +01:00
qlocale Fix assertion failure when parsing a doubly-invalid date-time text 2022-04-07 23:04:04 +02:00
qregularexpression QRegularExpression: print the pattern when warning 2022-02-22 21:15:31 +01:00
qstring Add literal operators for QString/QByteArray to StringLiterals namespace 2022-04-07 09:22:28 +02:00
qstring_no_cast_from_bytearray testlib: Deprecate QWARN() in favor of qWarning() 2021-08-04 19:31:51 +02:00
qstringapisymmetry Tests: Do not depend on transitive includes 2022-03-17 17:14:37 +01:00
qstringbuilder tst_QStringBuilder: remove test that doesn't test anything 2021-12-22 13:01:25 +01:00
qstringconverter Replace uses of _qs with _s in tests 2022-04-07 19:30:17 +02:00
qstringiterator Remove the qmake project files 2021-01-07 15:32:28 +01:00
qstringlist tst_QStringList: check that join(u'\0') embeds NULs 2021-12-28 23:09:44 +01:00
qstringmatcher Remove the qmake project files 2021-01-07 15:32:28 +01:00
qstringtokenizer QStringTokenizer::toContainer(): allow more types of target containers 2022-03-15 21:05:31 +01:00
qstringview Remove checks for features available in C++17 2021-10-02 17:54:39 +02:00
qtextboundaryfinder Cleanup tests that add test data to resources explicitly 2022-02-11 21:54:44 +01:00
qunicodetools Add additional grapheme, word, and sentence break class tests from tr29 2021-11-10 09:44:03 +01:00
shared QString/QByteArray::number(double): Test big numbers 2021-08-17 03:53:45 +02:00
CMakeLists.txt Rename tst_qlatin1string and switch to using QLatin1StringView 2022-03-19 18:51:08 +01:00