summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2018-04-11 19:11:34 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2018-04-12 11:48:06 +0000
commit5c63e6fd7541609c3fadb694c071b42e93b7acf5 (patch)
tree4336a62e0089ee8cc99829a4b457f843ee1fa74a /tests
parent6a4b6971f478400d22be7d9e2299862ba453ffc1 (diff)
Clean up some trivia in tst_QTimeZone
Fix a mistaken #ifdef that should have been #if; and only call QTimeZone::availableTimeZoneIds() once in transitionEachZone_data(), while switching to use of a ranged-for. Change-Id: Id27aae9ef450f21350283099c892ca7173884b94 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
index df4ae59631..d040f3bafd 100644
--- a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
+++ b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
@@ -481,8 +481,9 @@ void tst_QTimeZone::transitionEachZone_data()
};
QString name;
+ const auto zones = QTimeZone::availableTimeZoneIds();
for (int k = sizeof(table) / sizeof(table[0]); k-- > 0; ) {
- foreach (QByteArray zone, QTimeZone::availableTimeZoneIds()) {
+ for (const QByteArray &zone : zones) {
name.sprintf("%s@%d", zone.constData(), table[k].year);
QTest::newRow(name.toUtf8().constData())
<< zone
@@ -907,7 +908,7 @@ void tst_QTimeZone::tzTest()
QLocale enUS("en_US");
// Only test names in debug mode, names used can vary by ICU version installed
if (debug) {
-#ifdef QT_CONFIG(icu)
+#if QT_CONFIG(icu)
QCOMPARE(tzp.displayName(QTimeZone::StandardTime, QTimeZone::LongName, enUS),
QString("Central European Standard Time"));
QCOMPARE(tzp.displayName(QTimeZone::StandardTime, QTimeZone::ShortName, enUS),