diff options
Diffstat (limited to 'tests/auto/qtcpsocket/tst_qtcpsocket.cpp')
-rw-r--r-- | tests/auto/qtcpsocket/tst_qtcpsocket.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp index da3f19a..cf16abb 100644 --- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp @@ -81,10 +81,8 @@ #ifndef TEST_QNETWORK_PROXY //#define TEST_QNETWORK_PROXY #endif -#if defined(TEST_QNETWORK_PROXY) || defined (Q_CC_RVCT) // RVCT compiles also unused inline methods # include <QNetworkProxy> -#endif #ifdef Q_OS_LINUX #include <stdio.h> @@ -961,7 +959,11 @@ protected: { bool timedOut = false; while (!quit) { +#ifndef Q_OS_SYMBIAN if (server->waitForNewConnection(500, &timedOut)) +#else + if (server->waitForNewConnection(5000, &timedOut)) +#endif break; if (!timedOut) return; @@ -972,7 +974,7 @@ protected: #ifndef Q_OS_SYMBIAN if (socket->waitForDisconnected(500)) #else - if (socket->waitForDisconnected(1000)) + if (socket->waitForDisconnected(5000)) #endif break; if (socket->error() != QAbstractSocket::SocketTimeoutError) @@ -1024,7 +1026,7 @@ void tst_QTcpSocket::disconnectWhileConnectingNoEventLoop() #ifndef Q_OS_SYMBIAN QVERIFY2(socket->waitForDisconnected(10000), "Network timeout"); #else - QVERIFY2(socket->waitForDisconnected(20000), "Network timeout"); + QVERIFY2(socket->waitForDisconnected(30000), "Network timeout"); #endif QVERIFY(socket->state() == QAbstractSocket::UnconnectedState); if (!closeDirectly) { @@ -1035,7 +1037,7 @@ void tst_QTcpSocket::disconnectWhileConnectingNoEventLoop() delete socket; // check if the other side received everything ok - QVERIFY(thread.wait(10000)); + QVERIFY(thread.wait(30000)); QVERIFY(thread.ok); QCOMPARE(thread.receivedData, data); } @@ -1074,7 +1076,7 @@ void tst_QTcpSocket::disconnectWhileLookingUp() #ifndef Q_OS_SYMBIAN QTimer::singleShot(50, &loop, SLOT(quit())); #else - QTimer::singleShot(500, &loop, SLOT(quit())); + QTimer::singleShot(5000, &loop, SLOT(quit())); #endif loop.exec(); @@ -1181,7 +1183,7 @@ void tst_QTcpSocket::readLine() char buffer[1024]; int expectedReplySize = QtNetworkSettings::expectedReplyIMAP().size(); - ASSERT(expectedReplySize >= 3); + Q_ASSERT(expectedReplySize >= 3); QCOMPARE(socket->readLine(buffer, sizeof(buffer)), qint64(expectedReplySize)); QCOMPARE((int) buffer[expectedReplySize-2], (int) '\r'); @@ -1321,11 +1323,19 @@ void tst_QTcpSocket::dontCloseOnTimeout() QTcpSocket *socket = newSocket(); socket->connectToHost(serverAddress, server.serverPort()); +#ifndef Q_OS_SYMBIAN QVERIFY(!socket->waitForReadyRead(100)); +#else + QVERIFY(!socket->waitForReadyRead(5000)); +#endif QCOMPARE(socket->error(), QTcpSocket::SocketTimeoutError); QVERIFY(socket->isOpen()); +#ifndef Q_OS_SYMBIAN QVERIFY(!socket->waitForDisconnected(100)); +#else + QVERIFY(!socket->waitForDisconnected(5000)); +#endif QCOMPARE(socket->error(), QTcpSocket::SocketTimeoutError); QVERIFY(socket->isOpen()); |