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 <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a52a979abd58bde5823b15324595776b1e2e62b9)
This commit is contained in:
Edward Welbourne 2025-03-18 12:11:09 +01:00
parent 25e94ec4b3
commit b15a288f09

View File

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