diff options
author | Peter Hartmann <peter.hartmann@nokia.com> | 2009-10-29 16:55:06 (GMT) |
---|---|---|
committer | Peter Hartmann <peter.hartmann@nokia.com> | 2009-11-03 09:47:15 (GMT) |
commit | b22f7a8af0a781885a64d0cd1001192c99872aef (patch) | |
tree | 6aa576d85c3e7087c61c6c625ecadb2303ca54d4 /tests | |
parent | 83b5ae49a1778a815a98dd7094822588e82aef3c (diff) | |
download | Qt-b22f7a8af0a781885a64d0cd1001192c99872aef.zip Qt-b22f7a8af0a781885a64d0cd1001192c99872aef.tar.gz Qt-b22f7a8af0a781885a64d0cd1001192c99872aef.tar.bz2 |
QLocalSocket test: stabilize test by calling waitFor... function
... to make sure bytes are availabe to read
Reviewed-by: Aleksandar Sasha Babic
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qlocalsocket/tst_qlocalsocket.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp index ab7b0ac..5ead049 100644 --- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp @@ -587,14 +587,16 @@ void tst_QLocalSocket::readBufferOverflow() char buffer[dataBufferSize]; memset(buffer, 0, dataBufferSize); serverSocket->write(buffer, dataBufferSize); - serverSocket->flush(); + serverSocket->waitForBytesWritten(); + // wait until the first 128 bytes are ready to read QVERIFY(client.waitForReadyRead()); QCOMPARE(client.read(buffer, readBufferSize), qint64(readBufferSize)); -#if defined(QT_LOCALSOCKET_TCP) || defined(Q_OS_SYMBIAN) - QTest::qWait(250); -#endif + // wait until the second 128 bytes are ready to read + QVERIFY(client.waitForReadyRead()); QCOMPARE(client.read(buffer, readBufferSize), qint64(readBufferSize)); + // no more bytes available + QVERIFY(client.bytesAvailable() == 0); } // QLocalSocket/Server can take a name or path, check that it works as expected |