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>
This commit is contained in:
parent
b7613fb10f
commit
fd38c97a6c
@ -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"));
|
||||
|
@ -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"));
|
||||
|
Loading…
Reference in New Issue
Block a user