Add a reproducer tests for an assertion failure
The fix [*] means this already passes on dev; and the belated pick to 6.8 should get there before this does (it landed before 6.9, so did not need picked there). [*] commit 5d656e5085303bd427a4e8564818c65ec1d0ac26 On 6.8, without the fix, the ISODate test passes (that's handled by a sui generis parser) but all three of the fromStringFormat tests of QDate, and the QDatetime exact reproducer from the bug report, provoke assertion failures. Task-number: QTBUG-135382 Pick-to: 6.9 6.8 Change-Id: I303df9215873e37a9f2cbf5a78aab8ffa48f67aa Reviewed-by: Albert Astals Cid <aacid@kde.org>
This commit is contained in:
parent
b4d6892ba5
commit
79a1986e86
@ -1244,6 +1244,7 @@ void tst_QDate::fromStringDateFormat_data()
|
||||
QTest::newRow("iso8") << QString("2000-01-01blah") << Qt::ISODate << QDate(2000, 1, 1);
|
||||
QTest::newRow("iso9") << QString("-001-01-01") << Qt::ISODate << QDate();
|
||||
QTest::newRow("iso10") << QString("99999-01-01") << Qt::ISODate << QDate();
|
||||
QTest::newRow("iso-yr-0") << QString("0000-01-01") << Qt::ISODate << QDate();
|
||||
|
||||
// Test Qt::RFC2822Date format (RFC 2822).
|
||||
QTest::newRow("RFC 2822") << QString::fromLatin1("13 Feb 1987 13:24:51 +0100")
|
||||
@ -1449,6 +1450,13 @@ void tst_QDate::fromStringFormat_data()
|
||||
<< u"05--2006-21"_s << u"MM-yyyy-dd"_s << 1900 << QDate(-2006, 5, 21);
|
||||
QTest::newRow("-ve year: back, dash")
|
||||
<< u"05-21--2006"_s << u"MM-dd-yyyy"_s << 1900 << QDate(-2006, 5, 21);
|
||||
// zero year number is invalid
|
||||
QTest::newRow("year-zero-front")
|
||||
<< u"0000-05-21"_s << u"yyyy-MM-dd"_s << 1900 << QDate();
|
||||
QTest::newRow("year-zero-mid")
|
||||
<< u"05-0000-21"_s << u"MM-yyyy-dd"_s << 1900 << QDate();
|
||||
QTest::newRow("year-zero-back")
|
||||
<< u"05-21-0000"_s << u"MM-dd-yyyy"_s << 1900 << QDate();
|
||||
// negative three digit year numbers should be rejected:
|
||||
QTest::newRow("-ve 3digit year: front")
|
||||
<< u"-206-05-21"_s << u"yyyy-MM-dd"_s << 1900 << QDate();
|
||||
|
@ -3406,6 +3406,10 @@ void tst_QDateTime::fromStringStringFormat_data()
|
||||
QTest::newRow("UTC:min")
|
||||
<< u"0100 Jan 1 00:00:00 +00:00"_s << u"yyyy MMM d HH:mm:ss t"_s << 100
|
||||
<< QDate(100, 1, 1).startOfDay(QTimeZone::UTC);
|
||||
// Reproducer for QTBUG-135382:
|
||||
QTest::newRow("year-zero")
|
||||
<< u"0000-01-01T00:00:00.000"_s << u"yyyy-MM-ddThh:mm:ss.zzz"_s << 1900
|
||||
<< QDateTime();
|
||||
|
||||
// fuzzer test
|
||||
QTest::newRow("integer overflow found by fuzzer")
|
||||
|
Loading…
x
Reference in New Issue
Block a user