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 <thiago.macieira@intel.com>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This commit is contained in:
Edward Welbourne 2025-03-06 16:30:56 +01:00
parent 1b3b62d1b9
commit 0b67d44656

View File

@ -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()));