summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/text/qlocale/tst_qlocale.cpp26
-rw-r--r--tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp27
2 files changed, 11 insertions, 42 deletions
diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
index b9e14663ed..b46f9aa567 100644
--- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
@@ -1775,29 +1775,13 @@ void tst_QLocale::formatTimeZone()
qDebug("(Skipped some CET-only tests)");
}
-#ifdef Q_OS_ANDROID // Only reports (general) zones as offsets (QTBUG-68837)
- const QString cet(QStringLiteral("GMT+01:00"));
- const QString cest(QStringLiteral("GMT+02:00"));
-#elif defined Q_OS_DARWIN
- const QString cet(QStringLiteral("GMT+1"));
- const QString cest(QStringLiteral("GMT+2"));
-#else
- const QString cet(QStringLiteral("CET"));
- const QString cest(QStringLiteral("CEST"));
-#endif
-
#if QT_CONFIG(timezone)
- QDateTime dt6(QDate(2013, 1, 1), QTime(0, 0, 0), QTimeZone("Europe/Berlin"));
-#ifdef Q_OS_WIN
- QEXPECT_FAIL("", "QTimeZone windows backend only returns long name", Continue);
-#endif
- QCOMPARE(enUS.toString(dt6, "t"), cet);
+ const QTimeZone berlin("Europe/Berlin");
+ const QDateTime jan(QDate(2010, 1, 1).startOfDay(berlin));
+ const QDateTime jul(QDate(2010, 7, 1).startOfDay(berlin));
- QDateTime dt7(QDate(2013, 6, 1), QTime(0, 0, 0), QTimeZone("Europe/Berlin"));
-#ifdef Q_OS_WIN
- QEXPECT_FAIL("", "QTimeZone windows backend only returns long name", Continue);
-#endif
- QCOMPARE(enUS.toString(dt7, "t"), cest);
+ QCOMPARE(enUS.toString(jan, "t"), berlin.abbreviation(jan));
+ QCOMPARE(enUS.toString(jul, "t"), berlin.abbreviation(jul));
#endif
// Current datetime should return current abbreviation
diff --git a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp
index 23a99e2f47..b3deaf7bfe 100644
--- a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp
@@ -3021,28 +3021,13 @@ void tst_QDateTime::timeZoneAbbreviation()
qDebug("(Skipped some CET-only tests)");
}
-#ifdef Q_OS_ANDROID // Only reports (general) zones as offsets (QTBUG-68837)
- const QString cet(QStringLiteral("GMT+01:00"));
- const QString cest(QStringLiteral("GMT+02:00"));
-#elif defined Q_OS_DARWIN
- const QString cet(QStringLiteral("GMT+1"));
- const QString cest(QStringLiteral("GMT+2"));
-#else
- const QString cet(QStringLiteral("CET"));
- const QString cest(QStringLiteral("CEST"));
-#endif
-
#if QT_CONFIG(timezone)
- QDateTime dt5(QDate(2013, 1, 1), QTime(0, 0, 0), QTimeZone("Europe/Berlin"));
-#ifdef Q_OS_WIN
- QEXPECT_FAIL("", "Windows only reports long names (QTBUG-32759)", Continue);
-#endif
- QCOMPARE(dt5.timeZoneAbbreviation(), cet);
- QDateTime dt6(QDate(2013, 6, 1), QTime(0, 0, 0), QTimeZone("Europe/Berlin"));
-#ifdef Q_OS_WIN
- QEXPECT_FAIL("", "Windows only reports long names (QTBUG-32759)", Continue);
-#endif
- QCOMPARE(dt6.timeZoneAbbreviation(), cest);
+ const QTimeZone berlin("Europe/Berlin");
+ const QDateTime jan(QDate(2013, 1, 1).startOfDay(berlin));
+ const QDateTime jul(QDate(2013, 7, 1).startOfDay(berlin));
+
+ QCOMPARE(jan.timeZoneAbbreviation(), berlin.abbreviation(jan));
+ QCOMPARE(jul.timeZoneAbbreviation(), berlin.abbreviation(jul));
#endif
}