From f8e1194aefc1ad7119f4d08bd82d4c3c1cd6500e Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 26 Apr 2023 12:49:28 +0200 Subject: [PATCH] Check validity of startOfDay() and endOfDay() match expectation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-68855 Change-Id: I7fd9dac7db0f29c21e2f6e7bf284d708620508cc Reviewed-by: Qt CI Bot Reviewed-by: MÃ¥rten Nordheim --- tests/auto/corelib/time/qdate/tst_qdate.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/auto/corelib/time/qdate/tst_qdate.cpp b/tests/auto/corelib/time/qdate/tst_qdate.cpp index fc4f3ceaf68..7c1577c39a7 100644 --- a/tests/auto/corelib/time/qdate/tst_qdate.cpp +++ b/tests/auto/corelib/time/qdate/tst_qdate.cpp @@ -622,12 +622,18 @@ void tst_QDate::startOfDay_endOfDay() QCOMPARE(date.addDays(-1).endOfDay(zone).addMSecs(1), front); if (start.isValid()) { + QVERIFY(front.isValid()); QCOMPARE(front.date(), date); UNLESSKLUDGE(IgnoreStart) QCOMPARE(front.time(), start); + } else UNLESSKLUDGE(IgnoreStart) { + QVERIFY(!front.isValid()); } if (end.isValid()) { + QVERIFY(back.isValid()); QCOMPARE(back.date(), date); UNLESSKLUDGE(IgnoreEnd) QCOMPARE(back.time(), end); + } else UNLESSKLUDGE(IgnoreEnd) { + QVERIFY(!back.isValid()); } #undef UNLESSKLUDGE }