From a52a979abd58bde5823b15324595776b1e2e62b9 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 18 Mar 2025 12:11:09 +0100 Subject: [PATCH] Fix a double test to actually test double, rather than float The macro body did not use its type parameter and both uses of the macro in fact passed float for that parameter in any case, making the so-called double version of the test actually a redundant clone of the float form. This code is very ancient (harald, 2006). Pick-to: 6.9 6.8 6.5 5.15 Change-Id: Ib6b7231c2737346784385473a94f3936b08aed33 Reviewed-by: Marc Mutz Reviewed-by: Thiago Macieira --- .../corelib/serialization/qtextstream/tst_qtextstream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp index 1a3d161e788..13d1cf755e8 100644 --- a/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp @@ -2472,7 +2472,7 @@ void tst_QTextStream::generateRealNumbersDataWrite() buffer.open(QBuffer::WriteOnly); \ QTextStream stream(&buffer); \ stream.setLocale(QLocale::c()); \ - float f = (float)number; \ + type f = type(number); \ QVERIFY(stream << f); \ stream.flush(); \ QCOMPARE(buffer.data().constData(), data.constData()); \ @@ -2484,7 +2484,7 @@ void tst_QTextStream::generateRealNumbersDataWrite() QCOMPARE(buffer.data(), dataWithSeparators); \ } IMPLEMENT_STREAM_LEFT_REAL_OPERATOR_TEST(float, float) -IMPLEMENT_STREAM_LEFT_REAL_OPERATOR_TEST(double, float) +IMPLEMENT_STREAM_LEFT_REAL_OPERATOR_TEST(double, double) ; // ------------------------------------------------------------------------------