summaryrefslogtreecommitdiffstats
path: root/tests/auto/network
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2021-07-12 20:00:50 +0300
committerAlex Trotsenko <alex1973tr@gmail.com>2021-07-25 10:06:27 +0300
commit921ff400bbb84b0a5c51a9a04675dce17dac0cd8 (patch)
tree16a64d1e02ba845390ffb7014f578cac7c5f6e08 /tests/auto/network
parentf18d8fd1fb405d2cefea298e2383e5a2e76fcd7a (diff)
QLocalSocket/Win: allow delayed close to work
This mechanism was neither properly designed nor correctly tested initially on Windows. [ChangeLog][QtNetwork][Important Behavior Changes] QLocalSocket on Windows now implements delayed closing, which is consistent with the behavior on Unix. Change-Id: Ic3bc427e68eea7f18201f6129df19fbc87d68101 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Diffstat (limited to 'tests/auto/network')
-rw-r--r--tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
index 83cecdda6b..5cf02d3581 100644
--- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
@@ -1498,17 +1498,16 @@ void tst_QLocalSocket::writeToClientAndDisconnect()
QVERIFY(server.waitForNewConnection(200));
QLocalSocket* clientSocket = server.nextPendingConnection();
QVERIFY(clientSocket);
+ server.close();
char buffer[100];
memset(buffer, 0, sizeof(buffer));
for (int i = 0; i < chunks; ++i)
QCOMPARE(clientSocket->write(buffer, sizeof(buffer)), qint64(sizeof(buffer)));
- while (clientSocket->bytesToWrite())
- QVERIFY(clientSocket->waitForBytesWritten());
clientSocket->close();
- server.close();
+ QVERIFY(clientSocket->waitForDisconnected());
- client.waitForDisconnected();
+ QVERIFY(client.waitForDisconnected());
QCOMPARE(readChannelFinishedSpy.count(), 1);
const QByteArray received = client.readAll();
QCOMPARE(received.size(), qint64(sizeof(buffer) * chunks));