From 864520a0323fe56b290577befafd15b140433788 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 10 Sep 2009 16:59:58 +0200 Subject: make tst_QLocalSocket::writeToClientAndDisconnect more robust We must wait until all data is written before trying to read stuff. Reviewed-by: ossi --- tests/auto/qlocalsocket/tst_qlocalsocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp index 3c4af48..c0d870f 100644 --- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp @@ -893,7 +893,7 @@ void tst_QLocalSocket::writeToClientAndDisconnect() char buffer[100]; memset(buffer, 0, sizeof(buffer)); QCOMPARE(clientSocket->write(buffer, sizeof(buffer)), (qint64)sizeof(buffer)); - clientSocket->flush(); + clientSocket->waitForBytesWritten(); clientSocket->disconnectFromServer(); qApp->processEvents(); // give the socket the chance to receive data QCOMPARE(client.read(buffer, sizeof(buffer)), (qint64)sizeof(buffer)); -- cgit v0.12