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>
bb10
Edward Welbourne 2021-02-16 16:53:55 +01:00
parent 76c2e9ea23
commit 6fa9f487db
1 changed files with 10 additions and 0 deletions

View File

@ -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
}