From 67c45c1a4bf8064af04ef3bc6001968be1981307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 10 Nov 2015 14:51:41 +0100 Subject: [PATCH] [autotests] Destroy a created ClientConnection --- .../autotests/client/test_wayland_connection_thread.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wayland/autotests/client/test_wayland_connection_thread.cpp b/src/wayland/autotests/client/test_wayland_connection_thread.cpp index 5f4bad3636..ff9d8b02dd 100644 --- a/src/wayland/autotests/client/test_wayland_connection_thread.cpp +++ b/src/wayland/autotests/client/test_wayland_connection_thread.cpp @@ -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()