diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2019-11-14 16:40:21 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-11-27 18:27:43 +0100 |
commit | 0debb205b23a39b79650861de0e61cf4cf00286c (patch) | |
tree | fe494d9a2ec392d8cc6067f14d08dfcb9787b560 /tests/auto/corelib/time/qtime/tst_qtime.cpp | |
parent | 6566157df3c5a1352231be87c7b7d2705a46efe3 (diff) |
Permit leading space at start of RFC 2822 Date format
Relevant RFCs explicitly permit such space.
Change-Id: I8eb444e96287368cbbf973c77513b43d1d36f972
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/time/qtime/tst_qtime.cpp')
-rw-r--r-- | tests/auto/corelib/time/qtime/tst_qtime.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/corelib/time/qtime/tst_qtime.cpp b/tests/auto/corelib/time/qtime/tst_qtime.cpp index b2bb5dbb24..ed8700d93f 100644 --- a/tests/auto/corelib/time/qtime/tst_qtime.cpp +++ b/tests/auto/corelib/time/qtime/tst_qtime.cpp @@ -619,8 +619,14 @@ void tst_QTime::fromStringDateFormat_data() // Test Qt::RFC2822Date format (RFC 2822). QTest::newRow("RFC 2822") << QString::fromLatin1("13 Feb 1987 13:24:51 +0100") << Qt::RFC2822Date << QTime(13, 24, 51); + QTest::newRow("RFC 2822 after space") + << QString::fromLatin1(" 13 Feb 1987 13:24:51 +0100") + << Qt::RFC2822Date << QTime(13, 24, 51); QTest::newRow("RFC 2822 with day") << QString::fromLatin1("Thu, 01 Jan 1970 00:12:34 +0000") << Qt::RFC2822Date << QTime(0, 12, 34); + QTest::newRow("RFC 2822 with day after space") + << QString::fromLatin1(" Thu, 01 Jan 1970 00:12:34 +0000") + << Qt::RFC2822Date << QTime(0, 12, 34); // No timezone QTest::newRow("RFC 2822 no timezone") << QString::fromLatin1("01 Jan 1970 00:12:34") << Qt::RFC2822Date << QTime(0, 12, 34); @@ -651,6 +657,9 @@ void tst_QTime::fromStringDateFormat_data() // Test Qt::RFC2822Date format (RFC 850 and 1036, permissive). QTest::newRow("RFC 850 and 1036") << QString::fromLatin1("Fri Feb 13 13:24:51 1987 +0100") << Qt::RFC2822Date << QTime(13, 24, 51); + QTest::newRow("RFC 850 and 1036 after space") + << QString::fromLatin1(" Fri Feb 13 13:24:51 1987 +0100") + << Qt::RFC2822Date << QTime(13, 24, 51); // No timezone QTest::newRow("RFC 850 and 1036 no timezone") << QString::fromLatin1("Thu Jan 01 00:12:34 1970") << Qt::RFC2822Date << QTime(0, 12, 34); |