diff options
author | John Layt <jlayt@kde.org> | 2013-10-17 19:02:03 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-17 23:31:10 +0200 |
commit | 93f5e0598ad2c7738409eb027fc868ab35db5920 (patch) | |
tree | f8af354e20b47174246e1c51e805c6a85829bd28 /tests/auto | |
parent | 72544a5142b19454f9636c567ba199161c02e79b (diff) |
QDateTime - Fix RFC 2822 Date Formatting
The RFC 2822 date format should always use en_US locale for month and
day names instead of whatever the system locale is. Also remove some
duplicate code.
Change-Id: Ia2f7ee405b4e0e2f04980301783b9488628da73f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp index 0c560df423..0ee40713aa 100644 --- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp @@ -778,7 +778,11 @@ void tst_QDateTime::toString_rfcDate() QFETCH(QDateTime, dt); QFETCH(QString, formatted); + // Set to non-English locale to confirm still uses English + QLocale oldLocale; + QLocale::setDefault(QLocale("de_DE")); QCOMPARE(dt.toString(Qt::RFC2822Date), formatted); + QLocale::setDefault(oldLocale); } void tst_QDateTime::toString_enumformat() |