diff options
-rw-r--r-- | tests/auto/qlocalsocket/tst_qlocalsocket.cpp | 9 |
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 |