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()