summaryrefslogtreecommitdiffstats
path: root/tests/auto/qlocalsocket
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@nokia.com>2010-06-14 17:17:55 (GMT)
committerJoerg Bornemann <joerg.bornemann@nokia.com>2010-06-14 17:17:55 (GMT)
commitd61a1fecde3d4a5b34a849ae852a498e6bb1c2de (patch)
tree1b60bd41248fed507eee02384c0e5b9343679131 /tests/auto/qlocalsocket
parent1d307402d03dea32b6e95a1eec6a79448fbe892a (diff)
downloadQt-d61a1fecde3d4a5b34a849ae852a498e6bb1c2de.zip
Qt-d61a1fecde3d4a5b34a849ae852a498e6bb1c2de.tar.gz
Qt-d61a1fecde3d4a5b34a849ae852a498e6bb1c2de.tar.bz2
beautify tst_QLocalSocket::writeToClientAndDisconnect
Reviewed-by: ossi
Diffstat (limited to 'tests/auto/qlocalsocket')
-rw-r--r--tests/auto/qlocalsocket/tst_qlocalsocket.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
index 4cbb156..9c09917 100644
--- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
@@ -997,16 +997,9 @@ void tst_QLocalSocket::writeToClientAndDisconnect()
clientSocket->close();
server.close();
- // Wait for the client to notice the broken connection.
- int timeout = 5000;
- do {
- const int timestep = 100;
- QTest::qWait(timestep);
- timeout -= timestep;
- } while (!readChannelFinishedSpy.count() && timeout > 0);
-
- QCOMPARE(readChannelFinishedSpy.count(), 1);
+ QTRY_COMPARE(readChannelFinishedSpy.count(), 1);
QCOMPARE(client.read(buffer, sizeof(buffer)), (qint64)sizeof(buffer));
+ client.waitForDisconnected();
QCOMPARE(client.state(), QLocalSocket::UnconnectedState);
}