summaryrefslogtreecommitdiffstats
path: root/tests/auto/qlocalsocket
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@trolltech.com>2009-08-06 12:33:23 (GMT)
committerJoerg Bornemann <joerg.bornemann@trolltech.com>2009-08-06 15:20:56 (GMT)
commit2aeaf16a1e31856a3051e6727c5ff2695fec9625 (patch)
treeb17afd2b9f3de7cc5701145a66f47285e569b494 /tests/auto/qlocalsocket
parentda913bba1a0ecb4b5b8008b120d3951f1b69a2e5 (diff)
downloadQt-2aeaf16a1e31856a3051e6727c5ff2695fec9625.zip
Qt-2aeaf16a1e31856a3051e6727c5ff2695fec9625.tar.gz
Qt-2aeaf16a1e31856a3051e6727c5ff2695fec9625.tar.bz2
fix tst_qlocalsocket::readBufferOverflow for Windows CE
The TCP socket must get the chance to read data into its read buffer after the first read operation emptied it. Reviewed-by: thartman
Diffstat (limited to 'tests/auto/qlocalsocket')
-rw-r--r--tests/auto/qlocalsocket/tst_qlocalsocket.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
index b861e62..177648d 100644
--- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
@@ -555,14 +555,17 @@ void tst_QLocalSocket::readBufferOverflow()
QVERIFY(server.hasPendingConnections());
QLocalSocket* serverSocket = server.nextPendingConnection();
- char* buffer = (char*)qMalloc(dataBufferSize);
+ char buffer[dataBufferSize];
memset(buffer, 0, dataBufferSize);
serverSocket->write(buffer, dataBufferSize);
serverSocket->flush();
- qFree(buffer);
QVERIFY(client.waitForReadyRead());
- QCOMPARE(client.readAll().size(), dataBufferSize);
+ QCOMPARE(client.read(buffer, readBufferSize), qint64(readBufferSize));
+#ifdef QT_LOCALSOCKET_TCP
+ QTest::qWait(250);
+#endif
+ QCOMPARE(client.read(buffer, readBufferSize), qint64(readBufferSize));
}
// QLocalSocket/Server can take a name or path, check that it works as expected