From fd38c97a6c5b7bfab39b5f814d68a02e4d197e70 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 9 Aug 2018 15:20:50 +0200 Subject: Fix time-zone tests on macOS >= 10.13, which now knows what CET is MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Thiago Macieira Reviewed-by: Erik Verbruggen --- tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/auto/corelib/tools/qlocale') 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")); -- cgit v1.2.3