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

Add test case for operator cast in Client::Seat

parent d267cdca
......@@ -52,6 +52,7 @@ private Q_SLOTS:
void testCapabilities();
void testPointer();
void testKeyboard();
void testCast();
// TODO: add test for keymap
private:
......@@ -495,5 +496,27 @@ void TestWaylandSeat::testKeyboard()
QVERIFY(!serverKeyboard->focusedSurface());
}
void TestWaylandSeat::testCast()
{
using namespace KWayland::Client;
Registry registry;
QSignalSpy seatSpy(&registry, SIGNAL(seatAnnounced(quint32,quint32)));
registry.create(m_connection->display());
QVERIFY(registry.isValid());
registry.setup();
QVERIFY(seatSpy.wait());
Seat s;
QVERIFY(!s.isValid());
auto wlSeat = registry.bindSeat(seatSpy.first().first().value<quint32>(), seatSpy.first().last().value<quint32>());
QVERIFY(wlSeat);
s.setup(wlSeat);
QVERIFY(s.isValid());
QCOMPARE((wl_seat*)s, wlSeat);
const Seat &s2(s);
QCOMPARE((wl_seat*)s2, wlSeat);
}
QTEST_MAIN(TestWaylandSeat)
#include "test_wayland_seat.moc"
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