summaryrefslogtreecommitdiffstats
path: root/tests/auto/platformsocketengine
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2010-12-10 10:27:32 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2010-12-10 10:27:32 (GMT)
commitcb7a89049f1e41edf02aaab56a00cef8c6005eba (patch)
treee837ec91db9c6118f17cf777edaaac25b1fc7d1a /tests/auto/platformsocketengine
parent9c3967b7738b50655a7b9d6a5a0e89fdf2afc1df (diff)
downloadQt-cb7a89049f1e41edf02aaab56a00cef8c6005eba.zip
Qt-cb7a89049f1e41edf02aaab56a00cef8c6005eba.tar.gz
Qt-cb7a89049f1e41edf02aaab56a00cef8c6005eba.tar.bz2
Fixes for socket engine autotest failures
Reviewed-by: Markus Goetz
Diffstat (limited to 'tests/auto/platformsocketengine')
-rw-r--r--tests/auto/platformsocketengine/platformsocketengine.pro7
-rw-r--r--tests/auto/platformsocketengine/tst_platformsocketengine.cpp19
2 files changed, 21 insertions, 5 deletions
diff --git a/tests/auto/platformsocketengine/platformsocketengine.pro b/tests/auto/platformsocketengine/platformsocketengine.pro
index 04816af..faf745c 100644
--- a/tests/auto/platformsocketengine/platformsocketengine.pro
+++ b/tests/auto/platformsocketengine/platformsocketengine.pro
@@ -9,5 +9,8 @@ MOC_DIR=tmp
QT = core network
-symbian: TARGET.CAPABILITY = NetworkServices
-symbian: INCLUDEPATH += $$OS_LAYER_SYSTEMINCLUDE \ No newline at end of file
+symbian {
+ TARGET.CAPABILITY = NetworkServices
+ INCLUDEPATH += $$OS_LAYER_SYSTEMINCLUDE
+ LIBS += -lesock
+}
diff --git a/tests/auto/platformsocketengine/tst_platformsocketengine.cpp b/tests/auto/platformsocketengine/tst_platformsocketengine.cpp
index bede360..a7b4235 100644
--- a/tests/auto/platformsocketengine/tst_platformsocketengine.cpp
+++ b/tests/auto/platformsocketengine/tst_platformsocketengine.cpp
@@ -65,6 +65,7 @@
#ifdef Q_OS_SYMBIAN
#define PLATFORMSOCKETENGINE QSymbianSocketEngine
#include <private/qsymbiansocketengine_p.h>
+#include <private/qcore_symbian_p.h>
#else
#define PLATFORMSOCKETENGINE QNativeSocketEngine
#include <private/qnativesocketengine_p.h>
@@ -98,12 +99,12 @@ private slots:
void udpLoopbackPerformance();
void tcpLoopbackPerformance();
void readWriteBufferSize();
- void tooManySockets();
void bind();
void networkError();
void setSocketDescriptor();
void invalidSend();
void receiveUrgentData();
+ void tooManySockets();
};
tst_PlatformSocketEngine::tst_PlatformSocketEngine()
@@ -179,7 +180,9 @@ void tst_PlatformSocketEngine::simpleConnectToIMAP()
QVERIFY(socketDevice.read(array.data(), array.size()) == available);
// Check that the greeting is what we expect it to be
- QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData());
+ //QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData());
+ QVERIFY(array.startsWith("* OK"));
+ QVERIFY(array.endsWith("server ready\r\n"));
// Write a logout message
QByteArray array2 = "ZZZ LOGOUT\r\n";
@@ -487,7 +490,7 @@ void tst_PlatformSocketEngine::tcpLoopbackPerformance()
QVERIFY(client.state() == QAbstractSocket::ConnectedState);
}
- // The server accepts the connectio
+ // The server accepts the connection
int socketDescriptor = server.accept();
QVERIFY(socketDescriptor > 0);
@@ -497,7 +500,11 @@ void tst_PlatformSocketEngine::tcpLoopbackPerformance()
QVERIFY(serverSocket.initialize(socketDescriptor));
QVERIFY(serverSocket.state() == QAbstractSocket::ConnectedState);
+#if defined (Q_OS_SYMBIAN) && defined (__WINS__)
+ const int messageSize = 1024 * 16;
+#else
const int messageSize = 1024 * 256;
+#endif
QByteArray message1(messageSize, '@');
QByteArray answer(messageSize, '@');
@@ -610,6 +617,12 @@ void tst_PlatformSocketEngine::networkError()
#ifdef Q_OS_WIN
// could use shutdown to produce different errors
::closesocket(client.socketDescriptor());
+#elif defined(Q_OS_SYMBIAN)
+ RSocket sock;
+ QVERIFY(QSymbianSocketManager::instance().lookupSocket(client.socketDescriptor(), sock));
+ TRequestStatus stat;
+ sock.Shutdown(RSocket::EImmediate, stat);
+ User::WaitForRequest(stat);
#else
::close(client.socketDescriptor());
#endif