summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-10-21 16:48:12 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-24 05:00:44 +0200
commitf49bd470990b838bb2c1a79605621e2d8c786a0b (patch)
tree2977e6f46a86f04a5809170473beb18fc2d2c0bf
parent47fc4e0f8cd332621b09f80d17b20f1689d1e642 (diff)
Remove legacy Symbian code from qtestlib.
Change-Id: Ia4ac52ce0b5f5a4ba1fcd6594daf424fd7208777 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
-rw-r--r--src/testlib/qabstracttestlogger.cpp7
-rw-r--r--src/testlib/qplaintestlogger.cpp25
-rw-r--r--src/testlib/qtest_global.h4
-rw-r--r--src/testlib/qtestcase.cpp18
-rw-r--r--src/testlib/qtestcase.h24
-rw-r--r--src/testlib/testlib.pro1
6 files changed, 8 insertions, 71 deletions
diff --git a/src/testlib/qabstracttestlogger.cpp b/src/testlib/qabstracttestlogger.cpp
index 0d115b0b3e..f7d8842c4c 100644
--- a/src/testlib/qabstracttestlogger.cpp
+++ b/src/testlib/qabstracttestlogger.cpp
@@ -76,13 +76,6 @@ QAbstractTestLogger::~QAbstractTestLogger()
QTEST_ASSERT(stream);
if (stream != stdout) {
fclose(stream);
- } else {
-#ifdef Q_OS_SYMBIAN
- // Convenience sleep for Symbian and TRK. Without this sleep depending on the timing the
- // user would not see the complete output because it is still pending in any of the buffers
- // before arriving via the USB port on the development PC
- User::AfterHighRes(2*1000*1000);
-#endif
}
stream = 0;
}
diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp
index b9ede07704..45fc882492 100644
--- a/src/testlib/qplaintestlogger.cpp
+++ b/src/testlib/qplaintestlogger.cpp
@@ -55,10 +55,6 @@
#include <windows.h>
#endif
-#if defined(Q_OS_SYMBIAN)
-#include <e32debug.h>
-#endif
-
#ifdef Q_OS_WINCE
#include <QtCore/QString>
#endif
@@ -217,27 +213,6 @@ void QPlainTestLogger::outputMessage(const char *str)
// OutputDebugString is not threadsafe
OutputDebugStringA(str);
LeaveCriticalSection(&QTest::outputCriticalSection);
-#elif defined(Q_OS_SYMBIAN)
- // RDebug::Print has a cap of 256 characters so break it up
- TPtrC8 ptr(reinterpret_cast<const TUint8*>(str));
- _LIT(format, "[QTestLib] %S");
- const int maxBlockSize = 256 - ((const TDesC &)format).Length();
- HBufC* hbuffer = HBufC::New(maxBlockSize);
- if (hbuffer) {
- for (int i = 0; i < ptr.Length(); i += maxBlockSize) {
- int size = Min(maxBlockSize, ptr.Length() - i);
- hbuffer->Des().Copy(ptr.Mid(i, size));
- RDebug::Print(format, hbuffer);
- }
- delete hbuffer;
- }
- else {
- // fast, no allocations, but truncates silently
- RDebug::RawPrint(format);
- TPtrC8 ptr(reinterpret_cast<const TUint8*>(str));
- RDebug::RawPrint(ptr);
- RDebug::RawPrint(_L8("\n"));
- }
#endif
outputString(str);
}
diff --git a/src/testlib/qtest_global.h b/src/testlib/qtest_global.h
index 6789c5938c..730329a19c 100644
--- a/src/testlib/qtest_global.h
+++ b/src/testlib/qtest_global.h
@@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Test)
-#if !defined(QT_SHARED) && !defined(QT_DLL) && !(defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT))
+#if !defined(QT_SHARED) && !defined(QT_DLL)
# define Q_TESTLIB_EXPORT
#else
# ifdef QTESTLIB_MAKEDLL
@@ -60,7 +60,7 @@ QT_MODULE(Test)
# endif
#endif
-#if defined (Q_CC_SUN) || defined (Q_CC_XLC) || (defined (Q_CC_GNU) && (__GNUC__ - 0 < 3)) || defined (Q_CC_NOKIAX86)
+#if defined (Q_CC_SUN) || defined (Q_CC_XLC) || (defined (Q_CC_GNU) && (__GNUC__ - 0 < 3))
# define QTEST_NO_SPECIALIZATIONS
#endif
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index ff67820f15..79d96d8278 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -898,7 +898,7 @@ namespace QTest
static int mouseDelay = -1;
static int eventDelay = -1;
static int keyVerbose = -1;
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX)
static bool noCrashHandler = false;
#endif
@@ -1067,7 +1067,7 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml)
" -keyevent-verbose : Turn on verbose messages for keyboard simulation\n"
" -maxwarnings n : Sets the maximum amount of messages to output.\n"
" 0 means unlimited, default: 2000\n"
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX)
" -nocrashhandler : Disables the crash handler\n"
#endif
"\n"
@@ -1188,7 +1188,7 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml)
} else {
QTestLog::setMaxWarnings(qToInt(argv[++i]));
}
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX)
} else if (strcmp(argv[i], "-nocrashhandler") == 0) {
QTest::noCrashHandler = true;
#endif
@@ -1662,7 +1662,7 @@ static void qInvokeTestMethods(QObject *testObject)
QTestLog::stopLogging();
}
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX)
class FatalSignalHandler
{
public:
@@ -1822,14 +1822,6 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
}
#endif
-#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
- // Delay execution of tests in Symbian emulator.
- // Needed to allow worst of other higher priority apps and services launched by emulator
- // to get out of the way before we run our test. Otherwise some of the timing sensitive tests
- // will not work properly.
- qSleep(3000);
-#endif
-
QTestResult::reset();
QTEST_ASSERT(testObject);
@@ -1852,7 +1844,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
} else
#endif
{
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX)
QScopedPointer<FatalSignalHandler> handler;
if (!noCrashHandler)
handler.reset(new FatalSignalHandler);
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h
index 4d20de6fcd..0c06f3a095 100644
--- a/src/testlib/qtestcase.h
+++ b/src/testlib/qtestcase.h
@@ -275,7 +275,7 @@ namespace QTest
return qCompare<qreal>(qreal(t1), t2, actual, expected, file, line);
}
-#elif defined(QT_COORD_TYPE) || defined(QT_ARCH_ARM) || defined(QT_NO_FPU) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN)
+#elif defined(QT_COORD_TYPE) || defined(QT_ARCH_ARM) || defined(QT_NO_FPU) || defined(QT_ARCH_WINDOWSCE)
template <>
inline bool qCompare<qreal, double>(qreal const &t1, double const &t2, const char *actual,
const char *expected, const char *file, int line)
@@ -331,28 +331,6 @@ namespace QTest
return compare_string_helper(t1, t2, actual, expected, file, line);
}
#else /* QTEST_NO_SPECIALIZATIONS */
-
-// 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);
-
- 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
-
inline bool qCompare(const char *t1, const char *t2, const char *actual,
const char *expected, const char *file, int line)
{
diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro
index 183ad516de..71955fc3a6 100644
--- a/src/testlib/testlib.pro
+++ b/src/testlib/testlib.pro
@@ -83,4 +83,3 @@ QMAKE_TARGET_DESCRIPTION = Qt \
Unit \
Testing \
Library
-symbian:TARGET.UID3=0x2001B2DF