From 67ac8d72d5288c77540ed0db3039695ff533b002 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sat, 25 Feb 2012 13:56:11 +0100 Subject: QTestlib: no need to use the preprocessor to distinguish qreal The code paths are actually the same, so merge them. Change-Id: I456b8a9a825cccdd80cd6a52a0a6737cde252363 Reviewed-by: Jason McDonald --- src/testlib/qtestcase.h | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) (limited to 'src/testlib/qtestcase.h') diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index e4f4020461..c64420b000 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -264,38 +264,20 @@ namespace QTest template bool qCompare(T1 const &, T2 const &, const char *, const char *, const char *, int); -#if defined(QT_COORD_TYPE) && (defined(Q_PROCESSOR_ARM) || defined(QT_NO_FPU) || defined(Q_OS_WINCE)) template <> - inline bool qCompare(qreal const &t1, float const &t2, const char *actual, + inline bool qCompare(double const &t1, float const &t2, const char *actual, const char *expected, const char *file, int line) { - return qCompare(t1, qreal(t2), actual, expected, file, line); + return qCompare(qreal(t1), qreal(t2), actual, expected, file, line); } template <> - inline bool qCompare(float const &t1, qreal const &t2, const char *actual, + inline bool qCompare(float const &t1, double const &t2, const char *actual, const char *expected, const char *file, int line) { - return qCompare(qreal(t1), t2, actual, expected, file, line); + return qCompare(qreal(t1), qreal(t2), actual, expected, file, line); } -#elif defined(QT_COORD_TYPE) || defined(Q_PROCESSOR_ARM) || defined(QT_NO_FPU) || defined(Q_OS_WINCE) - template <> - inline bool qCompare(qreal const &t1, double const &t2, const char *actual, - const char *expected, const char *file, int line) - { - return qCompare(float(t1), float(t2), actual, expected, file, line); - } - - template <> - inline bool qCompare(double const &t1, qreal const &t2, const char *actual, - const char *expected, const char *file, int line) - { - return qCompare(float(t1), float(t2), actual, expected, file, line); - } - -#endif - template inline bool qCompare(const T *t1, const T *t2, const char *actual, const char *expected, const char *file, int line) -- cgit v1.2.3