Add test case for operator cast in Client::Seat
This commit is contained in:
parent
d267cdca02
commit
ff9c6ea23d
1 changed files with 23 additions and 0 deletions
|
@ -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(®istry, 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"
|
||||
|
|
Loading…
Reference in a new issue