summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtest_gui.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2012-09-20 16:36:51 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-09-23 23:29:42 +0200
commite44f1dabe44f4979da5da7d5d50395883f3de684 (patch)
treefed290bdb7e900c5bf5855cb1dae7979ca14e6f1 /src/testlib/qtest_gui.h
parentef23f5d9bd3d82a6a1b5c3adb50d6ad4bfe127bb (diff)
QTestLib: clean up qCompare specialisation/overload mix
qCompare() was both overloaded and specialised, but always as a template. This lead to the QIcon specialisation actually invoking qCompare(QFlags<void*>, ...) when specifically asking for qCompare<void*>() (detected by adding underlying-type detection to QFlags). Fix by preferring overloading and not specialising anything. Change-Id: Ie001ebb9dfb0847c6c33a3f45177a61579fd61ee Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/testlib/qtest_gui.h')
-rw-r--r--src/testlib/qtest_gui.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/testlib/qtest_gui.h b/src/testlib/qtest_gui.h
index 3fb57a00af..66e65f7bf3 100644
--- a/src/testlib/qtest_gui.h
+++ b/src/testlib/qtest_gui.h
@@ -77,16 +77,14 @@ QT_BEGIN_NAMESPACE
namespace QTest
{
-template<>
inline bool qCompare(QIcon const &t1, QIcon const &t2, const char *actual, const char *expected,
const char *file, int line)
{
QTEST_ASSERT(sizeof(QIcon) == sizeof(void *));
- return qCompare<void *>(*reinterpret_cast<void * const *>(&t1),
+ return qCompare(*reinterpret_cast<void * const *>(&t1),
*reinterpret_cast<void * const *>(&t2), actual, expected, file, line);
}
-template<>
inline bool qCompare(QImage const &t1, QImage const &t2,
const char *actual, const char *expected, const char *file, int line)
{
@@ -121,7 +119,6 @@ inline bool qCompare(QImage const &t1, QImage const &t2,
toString(t1), toString(t2), actual, expected, file, line);
}
-template<>
inline bool qCompare(QPixmap const &t1, QPixmap const &t2, const char *actual, const char *expected,
const char *file, int line)
{