summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestcase.h
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2009-06-29 07:35:39 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2009-06-29 07:35:39 (GMT)
commitc1e73ebf3b2f15646ba6b755a37b12e65881e9ae (patch)
tree924254550510249977afe0a1874246bfcc0c6b24 /src/testlib/qtestcase.h
parent9875973c21660afbe19430d9a71fe7c22a8feb4c (diff)
downloadQt-c1e73ebf3b2f15646ba6b755a37b12e65881e9ae.zip
Qt-c1e73ebf3b2f15646ba6b755a37b12e65881e9ae.tar.gz
Qt-c1e73ebf3b2f15646ba6b755a37b12e65881e9ae.tar.bz2
Removed the need for NokiaX86 compiler specific hacks from qtestcase.h by
properly exporting the toString specializations in qtestcase.cpp.
Diffstat (limited to 'src/testlib/qtestcase.h')
-rw-r--r--src/testlib/qtestcase.h38
1 files changed, 7 insertions, 31 deletions
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h
index b104e93..cda6eca 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