From 0b67d446566005e6409f816a6f223f26ef1994ca Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 6 Mar 2025 16:30:56 +0100 Subject: [PATCH] Turn a comment in a test into an actual check Saying the code should produce no warnings is all well and good, but testing it produces no warnings is obviously better. Pick-to: 6.5 6.8 6.9 Change-Id: Iafa82027fde9ef6c7157b42ff3bbcccb3d097230 Reviewed-by: Thiago Macieira Reviewed-by: Mitch Curtis --- tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp index 9cf5936037a..19f54fabc9c 100644 --- a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp @@ -3874,7 +3874,7 @@ void tst_QDateTime::printNegativeYear() const #if QT_CONFIG(datetimeparser) void tst_QDateTime::roundtripTextDate() const { - /* This code path should not result in warnings. */ + QTest::failOnWarning(); // This code path should not result in warnings. const QDateTime now(QDateTime::currentDateTime()); // TextDate drops millis: const QDateTime theDateTime(now.addMSecs(-now.time().msec()));