diff --git a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp index 1447d03054..dc3d3e0760 100644 --- a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp @@ -1610,10 +1610,15 @@ void tst_QDateTime::addMSecs() QCOMPARE(result.addMSecs(qint64(-nsecs) * 1000), dt); } }; +#define VERIFY(datum) \ + verify(datum); \ + if (QTest::currentTestFailed()) \ + return - verify(dt.addMSecs(qint64(nsecs) * 1000)); - verify(dt.addDuration(std::chrono::seconds(nsecs))); - verify(dt.addDuration(std::chrono::milliseconds(nsecs * 1000))); + VERIFY(dt.addMSecs(qint64(nsecs) * 1000)); + VERIFY(dt.addDuration(std::chrono::seconds(nsecs))); + VERIFY(dt.addDuration(std::chrono::milliseconds(nsecs * 1000))); +#undef VERIFY } #if QT_DEPRECATED_SINCE(6, 9)