wayland/autotests: Make sure SeatInterface gets deleted

This commit is contained in:
Aleix Pol 2022-07-26 19:08:38 +02:00 committed by Vlad Zahorodnii
parent 4af69643e1
commit a94f5c0d7f

View file

@ -32,7 +32,7 @@ void TestWaylandServerSeat::testCapabilities()
KWaylandServer::Display display;
display.addSocketName(s_socketName);
display.start();
SeatInterface *seat = new SeatInterface(&display);
SeatInterface *seat = new SeatInterface(&display, &display);
QVERIFY(!seat->hasKeyboard());
QVERIFY(!seat->hasPointer());
QVERIFY(!seat->hasTouch());
@ -82,7 +82,7 @@ void TestWaylandServerSeat::testName()
KWaylandServer::Display display;
display.addSocketName(s_socketName);
display.start();
SeatInterface *seat = new SeatInterface(&display);
SeatInterface *seat = new SeatInterface(&display, &display);
QCOMPARE(seat->name(), QString());
QSignalSpy nameSpy(seat, SIGNAL(nameChanged(QString)));
@ -101,7 +101,7 @@ void TestWaylandServerSeat::testPointerButton()
KWaylandServer::Display display;
display.addSocketName(s_socketName);
display.start();
SeatInterface *seat = new SeatInterface(&display);
SeatInterface *seat = new SeatInterface(&display, &display);
seat->setHasPointer(true);
// no button pressed yet, should be released and no serial
@ -132,7 +132,7 @@ void TestWaylandServerSeat::testPointerPos()
KWaylandServer::Display display;
display.addSocketName(s_socketName);
display.start();
SeatInterface *seat = new SeatInterface(&display);
SeatInterface *seat = new SeatInterface(&display, &display);
seat->setHasPointer(true);
QSignalSpy seatPosSpy(seat, SIGNAL(pointerPosChanged(QPointF)));
QVERIFY(seatPosSpy.isValid());
@ -162,7 +162,7 @@ void TestWaylandServerSeat::testRepeatInfo()
KWaylandServer::Display display;
display.addSocketName(s_socketName);
display.start();
SeatInterface *seat = new SeatInterface(&display);
SeatInterface *seat = new SeatInterface(&display, &display);
seat->setHasKeyboard(true);
QCOMPARE(seat->keyboard()->keyRepeatRate(), 0);
QCOMPARE(seat->keyboard()->keyRepeatDelay(), 0);
@ -181,14 +181,14 @@ void TestWaylandServerSeat::testMultiple()
display.addSocketName(s_socketName);
display.start();
QVERIFY(display.seats().isEmpty());
SeatInterface *seat1 = new SeatInterface(&display);
SeatInterface *seat1 = new SeatInterface(&display, &display);
QCOMPARE(display.seats().count(), 1);
QCOMPARE(display.seats().at(0), seat1);
SeatInterface *seat2 = new SeatInterface(&display);
SeatInterface *seat2 = new SeatInterface(&display, &display);
QCOMPARE(display.seats().count(), 2);
QCOMPARE(display.seats().at(0), seat1);
QCOMPARE(display.seats().at(1), seat2);
SeatInterface *seat3 = new SeatInterface(&display);
SeatInterface *seat3 = new SeatInterface(&display, &display);
QCOMPARE(display.seats().count(), 3);
QCOMPARE(display.seats().at(0), seat1);
QCOMPARE(display.seats().at(1), seat2);