From b15a288f092f68746a39bfdc75882d662a39275b 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.8 6.5 5.15 Change-Id: Ib6b7231c2737346784385473a94f3936b08aed33 Reviewed-by: Marc Mutz Reviewed-by: Thiago Macieira (cherry picked from commit a52a979abd58bde5823b15324595776b1e2e62b9) --- .../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 71063f39d0f..148852b80b4 100644 --- a/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp @@ -2446,7 +2446,7 @@ void tst_QTextStream::generateRealNumbersDataWrite() buffer.open(QBuffer::WriteOnly); \ QTextStream stream(&buffer); \ stream.setLocale(QLocale::c()); \ - float f = (float)number; \ + type f = type(number); \ stream << f; \ stream.flush(); \ QCOMPARE(buffer.data().constData(), data.constData()); \ @@ -2458,7 +2458,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) ; // ------------------------------------------------------------------------------