Add a test for QLocalSocket::open
This should have been done in the commit that introduced open
(953255abab
), but was missing.
Change-Id: I1c2de4ad5fa42aa5b90646e7d4d7d1b1570a0f87
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This commit is contained in:
parent
87db2fdef3
commit
4a7e37b0a3
@ -78,6 +78,8 @@ private slots:
|
|||||||
void listenAndConnect_data();
|
void listenAndConnect_data();
|
||||||
void listenAndConnect();
|
void listenAndConnect();
|
||||||
|
|
||||||
|
void connectWithOpen();
|
||||||
|
|
||||||
void sendData_data();
|
void sendData_data();
|
||||||
void sendData();
|
void sendData();
|
||||||
|
|
||||||
@ -452,6 +454,27 @@ void tst_QLocalSocket::listenAndConnect()
|
|||||||
QCOMPARE(spyNewConnection.count(), (canListen ? connections : 0));
|
QCOMPARE(spyNewConnection.count(), (canListen ? connections : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_QLocalSocket::connectWithOpen()
|
||||||
|
{
|
||||||
|
LocalServer server;
|
||||||
|
QVERIFY(server.listen("tst_qlocalsocket"));
|
||||||
|
|
||||||
|
LocalSocket socket;
|
||||||
|
socket.setServerName("tst_qlocalsocket");
|
||||||
|
QVERIFY(socket.open());
|
||||||
|
|
||||||
|
bool timedOut = true;
|
||||||
|
QVERIFY(server.waitForNewConnection(3000, &timedOut));
|
||||||
|
|
||||||
|
#if defined(QT_LOCALSOCKET_TCP)
|
||||||
|
QTest::qWait(250);
|
||||||
|
#endif
|
||||||
|
QVERIFY(!timedOut);
|
||||||
|
|
||||||
|
socket.close();
|
||||||
|
server.close();
|
||||||
|
}
|
||||||
|
|
||||||
void tst_QLocalSocket::sendData_data()
|
void tst_QLocalSocket::sendData_data()
|
||||||
{
|
{
|
||||||
listenAndConnect_data();
|
listenAndConnect_data();
|
||||||
|
Loading…
Reference in New Issue
Block a user