summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-11-15 11:36:18 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-18 01:51:57 +0100
commita8fd0c3654f8352773638633778cd8003680cbc7 (patch)
tree4815cca9daf879b96a92a3de95621b56ac5ba868 /tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
parentd90d57bb8b995c7a66e7f9b7b2515447fbe11de0 (diff)
Don't depend on moc to disable test functions.
The moc tool is not aware of all defines (particularly those that are compiler builtins) and does not correctly evaluate others that depend on compiler builtins, such as Q_OS_FOO. This commit reverts parts of the following commits, but is not a complete fix as there were many instances of this problem in the tests prior to those commits: 924d810dbdcd5b5b0fa860922b2487ea9062d002 8aaff6751038b88d17e23be6fcee945771297c5b 338d3f11973412047c2c9cd41cbd0c961d738ef3 a55034062ba2bf73a9f1ed3d9cf31745b38149e3 253497b7446c7d723aa3bdd7152e25d6852f2604 7cfad460c56319ba89c4a3a0bbcb2e54ab1cdbc6 9d2ff58f3642828e494e7e9b2df7dbb8e2cd408f 0cf6baa2d61ebaad2a2a0530c37f27e719b68f4b Change-Id: I947d797fe3ec76139ba1b55561cea569895662c5 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp')
-rw-r--r--tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp38
1 files changed, 15 insertions, 23 deletions
diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
index e881d56271..3fb4333494 100644
--- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
+++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
@@ -177,16 +177,12 @@ private slots:
void socketsInThreads();
void waitForReadyReadInASlot();
void remoteCloseError();
-#ifndef Q_OS_VXWORKS
void openMessageBoxInErrorSlot();
-#endif
#ifndef Q_OS_WIN
void connectToLocalHostNoService();
#endif
void waitForConnectedInHostLookupSlot();
-#if !defined(Q_OS_WIN) && !defined(Q_OS_VXWORKS)
void waitForConnectedInHostLookupSlot2();
-#endif
void readyReadSignalsAfterWaitForReadyRead();
#ifdef Q_OS_LINUX
void linuxKernelBugLocalSocket();
@@ -197,9 +193,7 @@ private slots:
void connectionRefused();
void suddenRemoteDisconnect_data();
void suddenRemoteDisconnect();
-#ifndef Q_OS_VXWORKS
void connectToMultiIP();
-#endif
void moveToThread0();
void increaseReadBufferSize();
void taskQtBug5799ConnectionErrorWaitForConnected();
@@ -225,9 +219,7 @@ protected slots:
void downloadBigFileSlot();
void recursiveReadyReadSlot();
void waitForReadyReadInASlotSlot();
-#ifndef Q_OS_VXWORKS
void messageBoxSlot();
-#endif
void hostLookupSlot();
void abortiveClose_abortSlot();
void remoteCloseErrorSlot();
@@ -1826,10 +1818,9 @@ void tst_QTcpSocket::remoteCloseErrorSlot()
static_cast<QTcpSocket *>(sender())->close();
}
-// VxWorks has no default gui
-#ifndef Q_OS_VXWORKS
void tst_QTcpSocket::messageBoxSlot()
{
+#if !defined(Q_OS_VXWORKS) // no gui
QTcpSocket *socket = qobject_cast<QTcpSocket *>(sender());
socket->deleteLater();
QMessageBox box;
@@ -1840,15 +1831,14 @@ void tst_QTcpSocket::messageBoxSlot()
// Fire a non-0 singleshot to leave time for the delete
QTimer::singleShot(250, this, SLOT(exitLoopSlot()));
-}
#endif
-
+}
//----------------------------------------------------------------------------------
-
-// VxWorks has no default gui
-#ifndef Q_OS_VXWORKS
void tst_QTcpSocket::openMessageBoxInErrorSlot()
{
+#if defined(Q_OS_VXWORKS) // no gui
+ QSKIP("no default gui available on VxWorks");
+#else
QTcpSocket *socket = newSocket();
QPointer<QTcpSocket> p(socket);
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(messageBoxSlot()));
@@ -1856,8 +1846,8 @@ void tst_QTcpSocket::openMessageBoxInErrorSlot()
socket->connectToHost("hostnotfoundhostnotfound.troll.no", 9999); // Host not found, fyi
enterLoop(30);
QVERIFY(!p);
-}
#endif
+}
//----------------------------------------------------------------------------------
#ifndef Q_OS_WIN
@@ -1978,10 +1968,12 @@ public slots:
};
//----------------------------------------------------------------------------------
-
-#if !defined(Q_OS_WIN) && !defined(Q_OS_VXWORKS)
void tst_QTcpSocket::waitForConnectedInHostLookupSlot2()
{
+#if defined(Q_OS_WIN) || defined(Q_OS_VXWORKS)
+ QSKIP("waitForConnectedInHostLookupSlot2 is not run on Windows and VxWorks");
+#else
+
Foo foo;
QPushButton top("Go", 0);
top.show();
@@ -1996,8 +1988,8 @@ void tst_QTcpSocket::waitForConnectedInHostLookupSlot2()
QVERIFY(foo.attemptedToConnect);
QCOMPARE(foo.count, 1);
-}
#endif
+}
//----------------------------------------------------------------------------------
void tst_QTcpSocket::readyReadSignalsAfterWaitForReadyRead()
@@ -2280,12 +2272,12 @@ void tst_QTcpSocket::suddenRemoteDisconnect()
//----------------------------------------------------------------------------------
-// VxSim in standard config doesn't even run a DNS resolver.
-#ifndef Q_OS_VXWORKS
void tst_QTcpSocket::connectToMultiIP()
{
QSKIP("TODO: setup DNS in the new network");
-
+#if defined(Q_OS_VXWORKS)
+ QSKIP("VxSim in standard config doesn't even run a DNS resolver");
+#else
QFETCH_GLOBAL(bool, ssl);
if (ssl)
return;
@@ -2313,8 +2305,8 @@ void tst_QTcpSocket::connectToMultiIP()
QCOMPARE(socket->error(), QAbstractSocket::SocketTimeoutError);
delete socket;
-}
#endif
+}
//----------------------------------------------------------------------------------
void tst_QTcpSocket::moveToThread0()