diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-02-23 14:29:26 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-05-06 11:39:57 (GMT) |
commit | a2a8773f8c226f79727b39d42c7796fc91c4d60e (patch) | |
tree | c650ed6f28d2a8fdb9b06732ad3cdec9f27bada7 /tests/auto | |
parent | 244f5ee9c2c34ddee200e4d5cdc1345762a5901b (diff) | |
download | Qt-a2a8773f8c226f79727b39d42c7796fc91c4d60e.zip Qt-a2a8773f8c226f79727b39d42c7796fc91c4d60e.tar.gz Qt-a2a8773f8c226f79727b39d42c7796fc91c4d60e.tar.bz2 |
test for queueing up pending connections
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qlocalsocket/tst_qlocalsocket.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp index deabda6..785eab0 100644 --- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp @@ -101,6 +101,8 @@ private slots: void recycleServer(); + void multiConnect(); + void debug(); }; @@ -842,6 +844,31 @@ void tst_QLocalSocket::recycleServer() QVERIFY(server.nextPendingConnection() != 0); } +void tst_QLocalSocket::multiConnect() +{ + QLocalServer server; + QLocalSocket client1; + QLocalSocket client2; + QLocalSocket client3; + + QVERIFY(server.listen("multiconnect")); + + client1.connectToServer("multiconnect"); + client2.connectToServer("multiconnect"); + client3.connectToServer("multiconnect"); + + QVERIFY(client1.waitForConnected(201)); + QVERIFY(client2.waitForConnected(202)); + QVERIFY(client3.waitForConnected(203)); + + QVERIFY(server.waitForNewConnection(201)); + QVERIFY(server.nextPendingConnection() != 0); + QVERIFY(server.waitForNewConnection(202)); + QVERIFY(server.nextPendingConnection() != 0); + QVERIFY(server.waitForNewConnection(203)); + QVERIFY(server.nextPendingConnection() != 0); +} + void tst_QLocalSocket::debug() { // Make sure this compiles |