summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@nokia.com>2010-06-14 17:16:13 (GMT)
committerJoerg Bornemann <joerg.bornemann@nokia.com>2010-06-14 17:16:13 (GMT)
commit1d307402d03dea32b6e95a1eec6a79448fbe892a (patch)
tree368d6e3b5a6244f7c68320ff24a0f4d57b329b11 /tests/auto
parentfd96a8180a5ccfeaea5b081c42137d18d640c25e (diff)
downloadQt-1d307402d03dea32b6e95a1eec6a79448fbe892a.zip
Qt-1d307402d03dea32b6e95a1eec6a79448fbe892a.tar.gz
Qt-1d307402d03dea32b6e95a1eec6a79448fbe892a.tar.bz2
QLocalSocket/Win: check for broken pipe in waitForReadyRead
In waitForReadyRead we didn't check for synchronous connection loss. Autotest added: tst_QLocalSocket::syncDisconnectNotify Reviewed-by: ossi
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 1acd669..4cbb156 100644
--- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
@@ -115,6 +115,7 @@ private slots:
void writeToClientAndDisconnect();
void debug();
void bytesWrittenSignal();
+ void syncDisconnectNotify();
void asyncDisconnectNotify();
#ifdef Q_OS_SYMBIAN
@@ -1061,6 +1062,22 @@ void tst_QLocalSocket::bytesWrittenSignal()
QVERIFY(writeThread.wait(2000));
}
+void tst_QLocalSocket::syncDisconnectNotify()
+{
+#ifdef Q_OS_SYMBIAN
+ unlink("syncDisconnectNotify");
+#endif
+
+ QLocalServer server;
+ QVERIFY(server.listen("syncDisconnectNotify"));
+ QLocalSocket client;
+ client.connectToServer("syncDisconnectNotify");
+ QVERIFY(server.waitForNewConnection());
+ QLocalSocket* serverSocket = server.nextPendingConnection();
+ QVERIFY(serverSocket);
+ delete serverSocket;
+ QCOMPARE(client.waitForReadyRead(), false);
+}
void tst_QLocalSocket::asyncDisconnectNotify()
{