summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-02-16 16:53:55 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2021-02-18 11:21:03 +0100
commit6fa9f487db1a1947815c9e4125688b9dc4df117f (patch)
tree8c38fc2ff6405a2cdaf87ff06b36dff337a5bcb2 /tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
parent76c2e9ea23e6bf9e9783813c89c80737ac72d468 (diff)
Return early after test-helpers if they fail
The QTimeZone tests have some helper functions to test details of a QTZP instance; these use QCOMPARE(), so may return early on failure. The callers then need to notice the failure and, in their turn, also return. Change-Id: I0a188e9641ced70c9ffedd95e91f39681fad768a Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp')
-rw-r--r--tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
index bf6a3f223d..0200085726 100644
--- a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
+++ b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
@@ -1072,6 +1072,8 @@ void tst_QTimeZone::icuTest()
}
testCetPrivate(tzp);
+ if (QTest::currentTestFailed())
+ return;
testEpochTranPrivate(QIcuTimeZonePrivate("America/Toronto"));
#endif // icu
}
@@ -1154,7 +1156,11 @@ void tst_QTimeZone::tzTest()
}
testCetPrivate(tzp);
+ if (QTest::currentTestFailed())
+ return;
testEpochTranPrivate(QTzTimeZonePrivate("America/Toronto"));
+ if (QTest::currentTestFailed())
+ return;
// Test first and last transition rule
// Warning: This could vary depending on age of TZ file!
@@ -1314,6 +1320,8 @@ void tst_QTimeZone::macTest()
}
testCetPrivate(tzp);
+ if (QTest::currentTestFailed())
+ return;
testEpochTranPrivate(QMacTimeZonePrivate("America/Toronto"));
#endif // QT_BUILD_INTERNAL && Q_OS_DARWIN
}
@@ -1380,6 +1388,8 @@ void tst_QTimeZone::winTest()
}
testCetPrivate(tzp);
+ if (QTest::currentTestFailed())
+ return;
testEpochTranPrivate(QWinTimeZonePrivate("America/Toronto"));
#endif // QT_BUILD_INTERNAL && USING_WIN_TZ
}