diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-01-07 14:44:52 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-01-08 12:43:02 +0100 |
commit | 338ae625a350d1e471a4033f1bcc6e1bfa9c1690 (patch) | |
tree | 32b45e4f24d909cd2f21537a34808713f2441e05 /tests | |
parent | 900ebd280da9b00f0e881043f155d5d6c8bc90e1 (diff) |
Correct #if-ery in QML locale's time-zone update test
The feature check for timezone should apply to the whole test; it
makes no sense without. The checks against Q_OS_WIN were redundant in
code already subject to a Q_OS_UNIX check.
Pick-to: 6.0 5.15
Task-number: QTBUG-89889
Change-Id: I419a775bf0777379662aa19e5b0c81fd6e0e26f6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qqmllocale/tst_qqmllocale.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp b/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp index 7d0c10a702..822fe33b83 100644 --- a/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp +++ b/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp @@ -73,7 +73,7 @@ private slots: void dateTimeFormat(); void timeFormat_data(); void timeFormat(); -#if defined(Q_OS_UNIX) +#if defined(Q_OS_UNIX) && QT_CONFIG(timezone) void timeZoneUpdated(); #endif @@ -1276,7 +1276,7 @@ QString DateFormatter::getLocalizedForm(const QString &isoTimestamp) return locale.toString(input); } -#if defined(Q_OS_UNIX) +#if defined(Q_OS_UNIX) && QT_CONFIG(timezone) // Currently disabled on Windows as adjusting the timezone // requires additional privileges that aren't normally // enabled for a process. This can be achieved by calling @@ -1327,8 +1327,10 @@ void tst_qqmllocale::timeZoneUpdated() obj.reset(c.create()); QVERIFY(obj); -#if !defined(Q_OS_WIN) && QT_CONFIG(timezone) && (!defined(Q_OS_LINUX) || defined(Q_OS_ANDROID)) - QEXPECT_FAIL("", "Date.timeZoneUpdated() only works on non-Android Linux with QT_CONFIG(timezone).", Continue); +#if !defined(Q_OS_LINUX) || defined(Q_OS_ANDROID) + QEXPECT_FAIL("", + "Date.timeZoneUpdated() only works on non-Android Linux with QT_CONFIG(timezone).", + Continue); #endif QVERIFY(obj->property("success").toBool()); @@ -1337,12 +1339,14 @@ void tst_qqmllocale::timeZoneUpdated() QMetaObject::invokeMethod(obj.data(), "check"); -#if !defined(Q_OS_WIN) && QT_CONFIG(timezone) && (!defined(Q_OS_LINUX) || defined(Q_OS_ANDROID)) - QEXPECT_FAIL("", "Date.timeZoneUpdated() only works on non-Android Linux with QT_CONFIG(timezone).", Continue); +#if !defined(Q_OS_LINUX) || defined(Q_OS_ANDROID) + QEXPECT_FAIL("", + "Date.timeZoneUpdated() only works on non-Android Linux with QT_CONFIG(timezone).", + Continue); #endif QVERIFY(obj->property("success").toBool()); } -#endif +#endif // Unix && timezone QTEST_MAIN(tst_qqmllocale) |