diff options
author | Jason Barron <jbarron@trolltech.com> | 2009-07-09 11:03:54 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-07-09 11:03:54 (GMT) |
commit | 8bc84e2180e1d5819b372f4cd8c236b853145803 (patch) | |
tree | 6c5e6a8b6a1750e2484fd34f48be662fcf51959f /src/testlib | |
parent | d641198fa71fadd243e84dfdf02b9a0536a27b3f (diff) | |
parent | 3b1e30bb1d6651a626aba1f6b8883f5524598ed3 (diff) | |
download | Qt-8bc84e2180e1d5819b372f4cd8c236b853145803.zip Qt-8bc84e2180e1d5819b372f4cd8c236b853145803.tar.gz Qt-8bc84e2180e1d5819b372f4cd8c236b853145803.tar.bz2 |
Merge commit 'origin/master' into 4.6-merged
Conflicts:
src/corelib/kernel/qcoreevent.cpp
src/corelib/tools/qdumper.cpp
src/gui/kernel/qwidget.cpp
src/gui/kernel/qwidget_p.h
src/gui/kernel/qwidget_s60.cpp
src/gui/text/qfontdatabase.cpp
src/network/access/qnetworkreplyimpl.cpp
src/sql/drivers/ibase/qsql_ibase.cpp
src/testlib/qtestcase.cpp
src/testlib/testlib.pro
tests/auto/network-settings.h
tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp
tests/auto/qobjectrace/tst_qobjectrace.cpp
tests/auto/qsqldatabase/tst_qsqldatabase.cpp
tools/configure/configureapp.cpp
translations/qt_ru.ts
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/qtestcase.cpp | 6 | ||||
-rw-r--r-- | src/testlib/qtestcase.h | 38 | ||||
-rw-r--r-- | src/testlib/testlib.pro | 2 |
3 files changed, 11 insertions, 35 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 35c2b4d..00e532a 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1766,7 +1766,7 @@ bool QTest::compare_helper(bool success, const char *msg, char *val1, char *val2 \internal */ template <> -bool QTest::qCompare<float>(float const &t1, float const &t2, const char *actual, const char *expected, +Q_TESTLIB_EXPORT bool QTest::qCompare<float>(float const &t1, float const &t2, const char *actual, const char *expected, const char *file, int line) { return qFuzzyCompare(t1, t2) @@ -1779,7 +1779,7 @@ bool QTest::qCompare<float>(float const &t1, float const &t2, const char *actual \internal */ template <> -bool QTest::qCompare<double>(double const &t1, double const &t2, const char *actual, const char *expected, +Q_TESTLIB_EXPORT bool QTest::qCompare<double>(double const &t1, double const &t2, const char *actual, const char *expected, const char *file, int line) { return qFuzzyCompare(t1, t2) @@ -1789,7 +1789,7 @@ bool QTest::qCompare<double>(double const &t1, double const &t2, const char *act } #define COMPARE_IMPL2(TYPE, FORMAT) \ -template <> char *QTest::toString<TYPE >(const TYPE &t) \ +template <> Q_TESTLIB_EXPORT char *QTest::toString<TYPE >(const TYPE &t) \ { \ char *msg = new char[128]; \ qt_snprintf(msg, 128, #FORMAT, t); \ diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index 7d71891..95fa512 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -119,22 +119,12 @@ class QTestData; namespace QTest { -#ifndef Q_CC_NOKIAX86 - template <typename T> + template <typename T> inline char *toString(const T &) { return 0; } -#else - // Nokia X86 compiler bug: - // does not export template specializations if parent template is inline - template <typename T> - Q_TESTLIB_EXPORT char *toString(const T &) - { - return 0; - } -#endif - + Q_TESTLIB_EXPORT char *toHexRepresentation(const char *ba, int length); Q_TESTLIB_EXPORT char *toString(const char *); @@ -179,7 +169,6 @@ namespace QTest } Q_TESTLIB_EXPORT QTestData &newRow(const char *dataTag); -#ifndef Q_CC_NOKIAX86 template <typename T> inline bool qCompare(T const &t1, T const &t2, const char *actual, const char *expected, const char *file, int line) @@ -189,19 +178,6 @@ namespace QTest : compare_helper(false, "Compared values are not the same", toString<T>(t1), toString<T>(t2), actual, expected, file, line); } -#else - // Nokia X86 compiler bug: - // does not export template specializations if parent template is inline - template <typename T> - Q_TESTLIB_EXPORT bool qCompare(T const &t1, T const &t2, const char *actual, const char *expected, - const char *file, int line) - { - return (t1 == t2) - ? compare_helper(true, "COMPARE()", file, line) - : compare_helper(false, "Compared values are not the same", - toString<T>(t1), toString<T>(t2), actual, expected, file, line); - } -#endif template <> @@ -316,8 +292,8 @@ namespace QTest } #else /* QTEST_NO_SPECIALIZATIONS */ -// In Synmbian we have QTEST_NO_SPECIALIZATIONS defined, but still float related specialization -// Should be uses. If QTEST_NO_SPECIALIZATIONS is enabled we get ambiguous overload errors +// In Symbian we have QTEST_NO_SPECIALIZATIONS defined, but still float related specialization +// should be used. If QTEST_NO_SPECIALIZATIONS is enabled we get ambiguous overload errors. #if defined(QT_ARCH_SYMBIAN) template <typename T1, typename T2> bool qCompare(T1 const &, T2 const &, const char *, const char *, const char *, int); @@ -370,12 +346,12 @@ namespace QTest return compare_string_helper(t1, t2, actual, expected, file, line); } - // NokiaX86 and RVCT do not like implicitly comparing bool with int + // NokiaX86 and RVCT do not like implicitly comparing bool with int #ifndef QTEST_NO_SPECIALIZATIONS template <> #endif inline bool qCompare(bool const &t1, int const &t2, - const char *actual, const char *expected, const char *file, int line) + const char *actual, const char *expected, const char *file, int line) { return qCompare<int>(int(t1), t2, actual, expected, file, line); } @@ -387,7 +363,7 @@ namespace QTest { return qCompare(actual, *static_cast<const T *>(QTest::qElementData(elementName, qMetaTypeId<T>())), actualStr, expected, file, line); - } + } } #undef QTEST_COMPARE_DECL diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro index 023c94f..00780b4 100644 --- a/src/testlib/testlib.pro +++ b/src/testlib/testlib.pro @@ -44,7 +44,7 @@ SOURCES = qtestcase.cpp \ qtestlightxmlstreamer.cpp \ qtestlogger.cpp \ qtestfilelogger.cpp -DEFINES += QT_NO_CAST_TO_ASCII \ +DEFINES *= QT_NO_CAST_TO_ASCII \ QT_NO_CAST_FROM_ASCII \ QTESTLIB_MAKEDLL \ QT_NO_DATASTREAM |