From 229c9736bb7738ae181f2db3fa71623b5b3582fb Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 18 Sep 2020 16:31:13 +0200 Subject: Check time-text is long enough while checking for its colons Added some tests that trigger an assert without this check. (Drive-by: renamed one QTime test to match its QDate(Time)? counterparts.) Change-Id: I3d6767605fdcca13a9b4d43a32904f584eb57cf9 Reviewed-by: Thiago Macieira Reviewed-by: Andrei Golubev Reviewed-by: Andreas Buhr --- tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp') diff --git a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp index 13176e5afc..d5fc0502d2 100644 --- a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp @@ -2508,6 +2508,8 @@ void tst_QDateTime::fromStringDateFormat_data() << Qt::RFC2822Date << QDateTime(); QTest::newRow("RFC 2822 with day date only") << QString::fromLatin1("Fri, 01 Nov 2002") << Qt::RFC2822Date << QDateTime(); + QTest::newRow("RFC 2822 malformed time") + << QString::fromLatin1("01 Nov 2002 0:") << Qt::RFC2822Date << QDateTime(); // Test invalid month, day, year QTest::newRow("RFC 2822 invalid month name") << QString::fromLatin1("13 Fev 1987 13:24:51 +0100") << Qt::RFC2822Date << QDateTime(); -- cgit v1.2.3