summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@trolltech.com>2009-07-09 16:09:12 (GMT)
committerJoerg Bornemann <joerg.bornemann@trolltech.com>2009-07-09 16:30:27 (GMT)
commit020ed5b7caaba5cf877cdb9ebaa575db1d15b7f0 (patch)
treea85c62ae06667c772d40ea48f0c188985f057a96 /tests/auto
parent4bec76fceb2297cdbde765b74075046b94bfaf75 (diff)
downloadQt-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.cpp17
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