summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2018-06-14 12:36:41 +0200
committerMÃ¥rten Nordheim <marten.nordheim@qt.io>2018-06-21 10:40:36 +0000
commitb248a35a090585dc81b52b3113a3a6a2926b9c50 (patch)
tree5d0a40618d5aebedfbd32d11aeaafaae596e589d /tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
parente08ba34f26197fb9893fd48a38bdd0dfff7d4a60 (diff)
Add Android to exceptions in tst_QDateTime::toString_textDate_extra()
Android doesn't use the proper zone-abbreviation, so just check it starts with the right date-time. Revised the way the #if-ery for that is handled, to avoid repetition of the (now more complex) condition in the two tests affected. Task-number: QTBUG-68833 Change-Id: Iceb5469f46c69ba5cdbaf7ca050ad70f2bb74f44 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp')
-rw-r--r--tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
index 867ca52d6f..e9d2fba47f 100644
--- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
@@ -924,12 +924,16 @@ void tst_QDateTime::toString_textDate_extra()
else
QCOMPARE(dt.toString(), QLatin1String("Thu Jan 1 00:00:00 1970"));
#if QT_CONFIG(timezone)
+# if defined Q_OS_UNIX && !defined Q_OS_DARWIN && !defined Q_OS_ANDROID
+# define CORRECT_ZONE_ABBREV
+# endif // QTBUG-57320, QTBUG-57298, QTBUG-68833
+
QTimeZone PST("America/Vancouver");
if (PST.isValid()) {
dt = QDateTime::fromMSecsSinceEpoch(0, PST);
-# if defined Q_OS_UNIX && !defined Q_OS_DARWIN
+# ifdef CORRECT_ZONE_ABBREV
QCOMPARE(dt.toString(), QLatin1String("Wed Dec 31 16:00:00 1969 PST"));
-# else // QTBUG-57320, QTBUG-57298
+# else
QVERIFY(dt.toString().startsWith(QLatin1String("Wed Dec 31 16:00:00 1969 ")));
# endif
dt = dt.toLocalTime();
@@ -940,9 +944,9 @@ void tst_QDateTime::toString_textDate_extra()
QTimeZone CET("Europe/Berlin");
if (CET.isValid()) {
dt = QDateTime::fromMSecsSinceEpoch(0, CET);
-# if defined Q_OS_UNIX && !defined Q_OS_DARWIN
+# ifdef CORRECT_ZONE_ABBREV
QCOMPARE(dt.toString(), QLatin1String("Thu Jan 1 01:00:00 1970 CET"));
-# else // QTBUG-57320, QTBUG-57298
+# else
QVERIFY(dt.toString().startsWith(QLatin1String("Thu Jan 1 01:00:00 1970 ")));
# endif
dt = dt.toLocalTime();