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 <jason.mcdonald@nokia.com>
This commit is contained in:
parent
643fd1afdd
commit
67ac8d72d5
@ -264,38 +264,20 @@ namespace QTest
|
||||
template <typename T1, typename T2>
|
||||
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, float>(qreal const &t1, float const &t2, const char *actual,
|
||||
inline bool qCompare<double, float>(double const &t1, float const &t2, const char *actual,
|
||||
const char *expected, const char *file, int line)
|
||||
{
|
||||
return qCompare<qreal>(t1, qreal(t2), actual, expected, file, line);
|
||||
return qCompare<qreal>(qreal(t1), qreal(t2), actual, expected, file, line);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline bool qCompare<float, qreal>(float const &t1, qreal const &t2, const char *actual,
|
||||
inline bool qCompare<float, double>(float const &t1, double const &t2, const char *actual,
|
||||
const char *expected, const char *file, int line)
|
||||
{
|
||||
return qCompare<qreal>(qreal(t1), t2, actual, expected, file, line);
|
||||
return qCompare<qreal>(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, double>(qreal const &t1, double const &t2, const char *actual,
|
||||
const char *expected, const char *file, int line)
|
||||
{
|
||||
return qCompare<float>(float(t1), float(t2), actual, expected, file, line);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline bool qCompare<double, qreal>(double const &t1, qreal const &t2, const char *actual,
|
||||
const char *expected, const char *file, int line)
|
||||
{
|
||||
return qCompare<float>(float(t1), float(t2), actual, expected, file, line);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
inline bool qCompare(const T *t1, const T *t2, const char *actual, const char *expected,
|
||||
const char *file, int line)
|
||||
|
Loading…
Reference in New Issue
Block a user