Commit 67c45c1a authored by Martin Flöser's avatar Martin Flöser
Browse files

[autotests] Destroy a created ClientConnection

parent 868282fb
......@@ -209,7 +209,10 @@ void TestWaylandConnectionThread::testConnectFd()
using namespace KWayland::Server;
int sv[2];
QVERIFY(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) >= 0);
QVERIFY(m_display->createClient(sv[0]));
auto c = m_display->createClient(sv[0])
QVERIFY(c);
QSignalSpy disconnectedSpy(c, &ClientConnection::disconnected);
QVERIFY(disconnectedSpy.isValid());
ConnectionThread *connection = new ConnectionThread;
QSignalSpy connectedSpy(connection, SIGNAL(connected()));
......@@ -237,6 +240,9 @@ void TestWaylandConnectionThread::testConnectFd()
connectionThread->quit();
connectionThread->wait();
delete connectionThread;
c->destroy();
QCOMPARE(disconnectedSpy.count(), 1);
}
void TestWaylandConnectionThread::testConnectFdNoSocketName()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment