diff options
Diffstat (limited to 'tests/auto/network/socket')
5 files changed, 54 insertions, 50 deletions
diff --git a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp index b362e6b08c..1b74d2ec55 100644 --- a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp +++ b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp @@ -85,7 +85,9 @@ private slots: void simpleConnectToIMAP(); void udpLoopbackTest(); void udpIPv6LoopbackTest(); +#ifndef Q_OS_AIX void broadcastTest(); +#endif void serverTest(); void udpLoopbackPerformance(); void tcpLoopbackPerformance(); @@ -95,7 +97,9 @@ private slots: void setSocketDescriptor(); void invalidSend(); void receiveUrgentData(); +#ifndef Q_OS_WIN void tooManySockets(); +#endif }; tst_PlatformSocketEngine::tst_PlatformSocketEngine() @@ -296,11 +300,10 @@ void tst_PlatformSocketEngine::udpIPv6LoopbackTest() } //--------------------------------------------------------------------------- + +#ifndef Q_OS_AIX void tst_PlatformSocketEngine::broadcastTest() { -#ifdef Q_OS_AIX - QSKIP("Broadcast does not work on darko", SkipAll); -#endif PLATFORMSOCKETENGINE broadcastSocket; // Initialize a regular Udp socket @@ -335,8 +338,8 @@ void tst_PlatformSocketEngine::broadcastTest() QVERIFY(broadcastSocket.readDatagram(response.data(), response.size()) == response.size()); QCOMPARE(response, trollMessage); - } +#endif //--------------------------------------------------------------------------- void tst_PlatformSocketEngine::serverTest() @@ -529,11 +532,11 @@ void tst_PlatformSocketEngine::readWriteBufferSize() } //--------------------------------------------------------------------------- + +// Certain windows machines suffocate and spend too much time in this test. +#ifndef Q_OS_WIN void tst_PlatformSocketEngine::tooManySockets() { -#if defined Q_OS_WIN - QSKIP("Certain windows machines suffocate and spend too much time in this test.", SkipAll); -#endif QList<PLATFORMSOCKETENGINE *> sockets; PLATFORMSOCKETENGINE *socketLayer = 0; for (;;) { @@ -548,6 +551,7 @@ void tst_PlatformSocketEngine::tooManySockets() qDeleteAll(sockets); } +#endif //--------------------------------------------------------------------------- void tst_PlatformSocketEngine::bind() diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp index fca2127fec..131fc71ff5 100644 --- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp @@ -92,8 +92,10 @@ private slots: void threadedConnection_data(); void threadedConnection(); +#ifndef QT_NO_PROCESS void processConnection_data(); void processConnection(); +#endif void longPath(); void waitForDisconnect(); @@ -739,6 +741,7 @@ void tst_QLocalSocket::threadedConnection() } } +#ifndef QT_NO_PROCESS void tst_QLocalSocket::processConnection_data() { QTest::addColumn<int>("processes"); @@ -755,9 +758,6 @@ void tst_QLocalSocket::processConnection_data() */ void tst_QLocalSocket::processConnection() { -#if defined(QT_NO_PROCESS) - QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll); -#else QFETCH(int, processes); QStringList serverArguments = QStringList() << SRCDIR "lackey/scripts/server.js" << QString::number(processes); QProcess producer; @@ -789,8 +789,8 @@ void tst_QLocalSocket::processConnection() delete consumer; } producer.waitForFinished(15000); -#endif } +#endif void tst_QLocalSocket::longPath() { diff --git a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp index c070be9e64..d982666931 100644 --- a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp +++ b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp @@ -105,7 +105,9 @@ private slots: void waitForConnectionTest(); void setSocketDescriptor(); void listenWhileListening(); +#ifndef QT_NO_PROCESS void addressReusable(); +#endif void setNewSocketDescriptorBlocking(); void invalidProxy_data(); void invalidProxy(); @@ -525,12 +527,9 @@ protected: } }; +#ifndef QT_NO_PROCESS void tst_QTcpServer::addressReusable() { -#if defined(QT_NO_PROCESS) - QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll); -#else - QFETCH_GLOBAL(bool, setProxy); if (setProxy) { QFETCH_GLOBAL(int, proxyType); @@ -567,8 +566,8 @@ void tst_QTcpServer::addressReusable() QTcpServer server; QVERIFY(server.listen(QHostAddress::LocalHost, 49199)); -#endif } +#endif void tst_QTcpServer::setNewSocketDescriptorBlocking() { diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp index fb22cb5940..6106960917 100644 --- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp @@ -176,12 +176,16 @@ 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(); @@ -192,7 +196,9 @@ private slots: void connectionRefused(); void suddenRemoteDisconnect_data(); void suddenRemoteDisconnect(); +#ifndef Q_OS_VXWORKS void connectToMultiIP(); +#endif void moveToThread0(); void increaseReadBufferSize(); void taskQtBug5799ConnectionErrorWaitForConnected(); @@ -218,7 +224,9 @@ protected slots: void downloadBigFileSlot(); void recursiveReadyReadSlot(); void waitForReadyReadInASlotSlot(); +#ifndef Q_OS_VXWORKS void messageBoxSlot(); +#endif void hostLookupSlot(); void abortiveClose_abortSlot(); void remoteCloseErrorSlot(); @@ -1759,9 +1767,10 @@ 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; @@ -1772,14 +1781,15 @@ void tst_QTcpSocket::messageBoxSlot() // Fire a non-0 singleshot to leave time for the delete QTimer::singleShot(250, this, SLOT(exitLoopSlot())); -#endif } +#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", SkipAll); -#else QTcpSocket *socket = newSocket(); QPointer<QTcpSocket> p(socket); connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(messageBoxSlot())); @@ -1787,8 +1797,8 @@ void tst_QTcpSocket::openMessageBoxInErrorSlot() socket->connectToHost("hostnotfoundhostnotfound.troll.no", 9999); // Host not found, fyi enterLoop(30); QVERIFY(!p); -#endif } +#endif //---------------------------------------------------------------------------------- #ifndef Q_OS_WIN @@ -1909,12 +1919,10 @@ 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", SkipAll); -#else - Foo foo; QPushButton top("Go", 0); top.show(); @@ -1929,8 +1937,8 @@ void tst_QTcpSocket::waitForConnectedInHostLookupSlot2() QVERIFY(foo.attemptedToConnect); QCOMPARE(foo.count, 1); -#endif } +#endif //---------------------------------------------------------------------------------- void tst_QTcpSocket::readyReadSignalsAfterWaitForReadyRead() @@ -2212,13 +2220,13 @@ 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", SkipAll); -#if defined(Q_OS_VXWORKS) - QSKIP("VxSim in standard config doesn't even run a DNS resolver", SkipAll); -#else QFETCH_GLOBAL(bool, ssl); if (ssl) return; @@ -2246,8 +2254,8 @@ void tst_QTcpSocket::connectToMultiIP() QCOMPARE(socket->error(), QAbstractSocket::SocketTimeoutError); delete socket; -#endif } +#endif //---------------------------------------------------------------------------------- void tst_QTcpSocket::moveToThread0() diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index 47d1908d7d..b2cbe11796 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -85,7 +85,9 @@ public slots: private slots: void constructing(); void unconnectedServerAndClientTest(); +#ifndef Q_OS_AIX void broadcasting(); +#endif void loop_data(); void loop(); void ipv6Loop_data(); @@ -100,8 +102,10 @@ private slots: void writeDatagramToNonExistingPeer(); void writeToNonExistingPeer_data(); void writeToNonExistingPeer(); +#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS) void outOfProcessConnectedClientServerTest(); void outOfProcessUnconnectedClientServerTest(); +#endif void zeroLengthDatagram(); void multicastTtlOption_data(); void multicastTtlOption(); @@ -236,6 +240,7 @@ void tst_QUdpSocket::unconnectedServerAndClientTest() //---------------------------------------------------------------------------------- +#ifndef Q_OS_AIX void tst_QUdpSocket::broadcasting() { QFETCH_GLOBAL(bool, setProxy); @@ -245,9 +250,6 @@ void tst_QUdpSocket::broadcasting() QSKIP("With socks5 Broadcast is not supported.", SkipSingle); } } -#ifdef Q_OS_AIX - QSKIP("Broadcast does not work on darko", SkipAll); -#endif const char *message[] = {"Yo mista", "", "Yo", "Wassap"}; QList<QHostAddress> broadcastAddresses; @@ -308,6 +310,7 @@ void tst_QUdpSocket::broadcasting() } } } +#endif //---------------------------------------------------------------------------------- @@ -790,15 +793,10 @@ void tst_QUdpSocket::writeToNonExistingPeer() QCOMPARE(int(sConnected.state()), int(QUdpSocket::ConnectedState)); } +// This test depends on reading data from QProcess (not supported on Qt/WinCE). +#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS) void tst_QUdpSocket::outOfProcessConnectedClientServerTest() { -#if defined(Q_OS_WINCE) - QSKIP("This test depends on reading data from QProcess (not supported on Qt/WinCE).", SkipAll); -#endif -#if defined(QT_NO_PROCESS) - QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll); -#else - QProcess serverProcess; serverProcess.start(QLatin1String("clientserver/clientserver server 1 1"), QIODevice::ReadWrite | QIODevice::Text); @@ -852,18 +850,13 @@ void tst_QUdpSocket::outOfProcessConnectedClientServerTest() QVERIFY(clientProcess.waitForFinished()); serverProcess.kill(); QVERIFY(serverProcess.waitForFinished()); -#endif } +#endif +// This test depends on reading data from QProcess (not supported on Qt/WinCE). +#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS) void tst_QUdpSocket::outOfProcessUnconnectedClientServerTest() { -#if defined(Q_OS_WINCE) - QSKIP("This test depends on reading data from QProcess (not supported on Qt/WinCE).", SkipAll); -#endif -#if defined(QT_NO_PROCESS) - QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll); -#else - QProcess serverProcess; serverProcess.start(QLatin1String("clientserver/clientserver server 1 1"), QIODevice::ReadWrite | QIODevice::Text); @@ -918,8 +911,8 @@ void tst_QUdpSocket::outOfProcessUnconnectedClientServerTest() QVERIFY(clientProcess.waitForFinished()); serverProcess.kill(); QVERIFY(serverProcess.waitForFinished()); -#endif } +#endif void tst_QUdpSocket::zeroLengthDatagram() { |