From 6fa9f487db1a1947815c9e4125688b9dc4df117f Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 16 Feb 2021 16:53:55 +0100 Subject: Return early after test-helpers if they fail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Andrei Golubev --- tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp') 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 } -- cgit v1.2.3