summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-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