diff options
author | Joerg Bornemann <joerg.bornemann@trolltech.com> | 2009-07-09 16:09:12 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@trolltech.com> | 2009-07-09 16:30:27 (GMT) |
commit | 020ed5b7caaba5cf877cdb9ebaa575db1d15b7f0 (patch) | |
tree | a85c62ae06667c772d40ea48f0c188985f057a96 /tests/auto | |
parent | 4bec76fceb2297cdbde765b74075046b94bfaf75 (diff) | |
download | Qt-020ed5b7caaba5cf877cdb9ebaa575db1d15b7f0.zip Qt-020ed5b7caaba5cf877cdb9ebaa575db1d15b7f0.tar.gz Qt-020ed5b7caaba5cf877cdb9ebaa575db1d15b7f0.tar.bz2 |
QLocalSocket WriteOnly mode fixed on Windows
Write only local sockets silently disconnected after some time.
Reason: we cannot call PeekNamedPipe on a write only pipe.
Task-number: 257714
Reviewed-by: ossi
Autotest: tst_QLocalSocket::writeOnlySocket
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qlocalsocket/tst_qlocalsocket.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp index 0f636a4..a41eecd 100644 --- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp @@ -104,6 +104,7 @@ private slots: void recycleServer(); void multiConnect(); + void writeOnlySocket(); void debug(); @@ -906,6 +907,22 @@ void tst_QLocalSocket::multiConnect() QVERIFY(server.nextPendingConnection() != 0); } +void tst_QLocalSocket::writeOnlySocket() +{ + QLocalServer server; + QVERIFY(server.listen("writeOnlySocket")); + + QLocalSocket client; + client.connectToServer("writeOnlySocket", QIODevice::WriteOnly); + QVERIFY(client.waitForConnected()); + + QVERIFY(server.waitForNewConnection()); + QLocalSocket* serverSocket = server.nextPendingConnection(); + + QCOMPARE(client.bytesAvailable(), qint64(0)); + QCOMPARE(client.state(), QLocalSocket::ConnectedState); +} + void tst_QLocalSocket::debug() { // Make sure this compiles |