summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2020-09-18 16:31:13 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2020-10-19 17:44:05 +0200
commit229c9736bb7738ae181f2db3fa71623b5b3582fb (patch)
treeb0c8373c2488bfdb469320d32ef72230ea2306b0 /tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp
parent9d2a107da2e5af77dece660b5d2b0958e79dc284 (diff)
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 <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Diffstat (limited to 'tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp')
-rw-r--r--tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp2
1 files changed, 2 insertions, 0 deletions
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();