diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2018-08-09 15:20:50 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2018-08-13 16:17:09 +0000 |
commit | fd38c97a6c5b7bfab39b5f814d68a02e4d197e70 (patch) | |
tree | 38833988a93d1dd587337d91f3100bedc0f150ab /tests | |
parent | b7613fb10fe1774b89fb197d295a3e229404fc45 (diff) |
Fix time-zone tests on macOS >= 10.13, which now knows what CET is
These tests kludge round Apple's use of GMT+1 and GMT+2 as names for
CET and CEST on Darwin; but 10.13 actually gets the names right, so
side-step out of the kludge when on this version or later.
Change-Id: Icb8a2f3ac30f0f621a19042dc03e0d281782dd41
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp | 16 | ||||
-rw-r--r-- | tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 16 |
2 files changed, 16 insertions, 16 deletions
diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp index d460beafde..c0b7674f22 100644 --- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp @@ -2726,15 +2726,15 @@ void tst_QDateTime::timeZoneAbbreviation() qDebug("(Skipped some CET-only tests)"); } + QString cet(QStringLiteral("CET")), cest(QStringLiteral("CEST")); #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")); + cet = QStringLiteral("GMT+01:00"); + cest = QStringLiteral("GMT+02:00"); +#elif defined Q_OS_DARWIN // Lacked real names until 10.13, High Sierra + if (QOperatingSystemVersion::current() < QOperatingSystemVersion::MacOSHighSierra) { + cet = QStringLiteral("GMT+1"); + cest = QStringLiteral("GMT+2"); + } #endif QDateTime dt5(QDate(2013, 1, 1), QTime(0, 0, 0), QTimeZone("Europe/Berlin")); diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index b76851a0ec..d649e66158 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -1585,15 +1585,15 @@ void tst_QLocale::formatTimeZone() qDebug("(Skipped some CET-only tests)"); } + QString cet(QStringLiteral("CET")), cest(QStringLiteral("CEST")); #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")); + cet = QStringLiteral("GMT+01:00"); + cest = QStringLiteral("GMT+02:00"); +#elif defined Q_OS_DARWIN // Lacked real names until 10.13, High Sierra + if (QOperatingSystemVersion::current() < QOperatingSystemVersion::MacOSHighSierra) { + cet = QStringLiteral("GMT+1"); + cest = QStringLiteral("GMT+2"); + } #endif QDateTime dt6(QDate(2013, 1, 1), QTime(0, 0, 0), QTimeZone("Europe/Berlin")); |