diff options
Diffstat (limited to 'src/testlib/qtestcase.h')
-rw-r--r-- | src/testlib/qtestcase.h | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index 79ec4c6037..1bfefaf2b0 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -230,12 +230,10 @@ namespace QTest toString<T>(t1), toString<T>(t2), actual, expected, file, line); } - template <> - Q_TESTLIB_EXPORT bool qCompare<float>(float const &t1, float const &t2, + Q_TESTLIB_EXPORT bool qCompare(float const &t1, float const &t2, const char *actual, const char *expected, const char *file, int line); - template <> - Q_TESTLIB_EXPORT bool qCompare<double>(double const &t1, double const &t2, + Q_TESTLIB_EXPORT bool qCompare(double const &t1, double const &t2, const char *actual, const char *expected, const char *file, int line); inline bool compare_ptr_helper(const void *t1, const void *t2, const char *actual, @@ -267,18 +265,16 @@ namespace QTest template <typename T1, typename T2> bool qCompare(T1 const &, T2 const &, const char *, const char *, const char *, int); - template <> - inline bool qCompare<double, float>(double 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<qreal>(qreal(t1), qreal(t2), actual, expected, file, line); + return qCompare(qreal(t1), qreal(t2), actual, expected, file, line); } - template <> - inline bool qCompare<float, double>(float const &t1, double 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>(qreal(t1), qreal(t2), actual, expected, file, line); + return qCompare(qreal(t1), qreal(t2), actual, expected, file, line); } template <typename T> @@ -307,29 +303,25 @@ namespace QTest return compare_ptr_helper(const_cast<const T1 *>(t1), static_cast<const T1 *>(const_cast<const T2 *>(t2)), actual, expected, file, line); } - template<> - inline bool qCompare<char>(const char *t1, const char *t2, const char *actual, + inline bool qCompare(const char *t1, const char *t2, const char *actual, const char *expected, const char *file, int line) { return compare_string_helper(t1, t2, actual, expected, file, line); } - template<> - inline bool qCompare<char>(char *t1, char *t2, const char *actual, const char *expected, + inline bool qCompare(char *t1, char *t2, const char *actual, const char *expected, const char *file, int line) { return compare_string_helper(t1, t2, actual, expected, file, line); } - /* The next two specializations are for MSVC that shows problems with implicit + /* The next two overloads are for MSVC that shows problems with implicit conversions */ - template<> inline bool qCompare(char *t1, const char *t2, const char *actual, const char *expected, const char *file, int line) { return compare_string_helper(t1, t2, actual, expected, file, line); } - template<> inline bool qCompare(const char *t1, char *t2, const char *actual, const char *expected, const char *file, int line) { @@ -337,11 +329,10 @@ namespace QTest } // NokiaX86 and RVCT do not like implicitly comparing bool with int - template <> inline bool qCompare(bool const &t1, int const &t2, const char *actual, const char *expected, const char *file, int line) { - return qCompare<int>(int(t1), t2, actual, expected, file, line); + return qCompare(int(t1), t2, actual, expected, file, line); } |