diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2019-11-13 18:42:00 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-11-27 18:27:43 +0100 |
commit | 6566157df3c5a1352231be87c7b7d2705a46efe3 (patch) | |
tree | 060a2504e8971956a84251985eee4d24e1fa0140 /tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp | |
parent | 8a60244da8f34aaa4ba0f71ada5b87aee33e0715 (diff) |
Make Qt::RFC2822Date's doc match up with its implementation
The qdatetime implementation's rfcDateImpl() uses regexes which did
not match its comments; nor did either the regexes or the comments
match what was documented. A review of relevant RFCs suggests we
should revise this in future, probably at Qt 6.
The documentation also only addressed the formats recognized when
parsing a date-time, without indicating how they are serialised or how
dates and times are handled separately.
Added a note to the tests for the read-only formats, to remind the
reader that the RFCs merely recommend recognising these - be
permissive in what you expect and strict in what you deliver.
Change-Id: I0f0bec752e7a50bde98cceceb7e0d11be15c6a6f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp')
-rw-r--r-- | tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp index 216ae1f79e..a5482657aa 100644 --- a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp @@ -2351,7 +2351,7 @@ void tst_QDateTime::fromStringDateFormat_data() QTest::newRow("RFC 2822 invalid character 2 at front") << QString::fromLatin1("!!01 Jan 2012 08:00:00 +0000") << Qt::RFC2822Date << invalidDateTime(); - // Test Qt::RFC2822Date format (RFC 850 and 1036). + // Test Qt::RFC2822Date format (RFC 850 and 1036, permissive). QTest::newRow("RFC 850 and 1036 +0100") << QString::fromLatin1("Fri Feb 13 13:24:51 1987 +0100") << Qt::RFC2822Date << QDateTime(QDate(1987, 2, 13), QTime(12, 24, 51), Qt::UTC); QTest::newRow("RFC 850 and 1036 -0100") << QString::fromLatin1("Fri Feb 13 13:24:51 1987 -0100") |