Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KWin
Commits
6ea3abc5
Commit
6ea3abc5
authored
Sep 22, 2014
by
Martin Flöser
Browse files
Add test case for Seat::destroy
parent
ff9c6ea2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/wayland/autotests/client/test_wayland_seat.cpp
View file @
6ea3abc5
...
...
@@ -53,6 +53,7 @@ private Q_SLOTS:
void
testPointer
();
void
testKeyboard
();
void
testCast
();
void
testDestroy
();
// TODO: add test for keymap
private:
...
...
@@ -518,5 +519,28 @@ void TestWaylandSeat::testCast()
QCOMPARE
((
wl_seat
*
)
s2
,
wlSeat
);
}
void
TestWaylandSeat
::
testDestroy
()
{
using
namespace
KWayland
::
Client
;
delete
m_compositor
;
m_compositor
=
nullptr
;
connect
(
m_connection
,
&
ConnectionThread
::
connectionDied
,
m_seat
,
&
Seat
::
destroy
);
QVERIFY
(
m_seat
->
isValid
());
QSignalSpy
connectionDiedSpy
(
m_connection
,
SIGNAL
(
connectionDied
()));
QVERIFY
(
connectionDiedSpy
.
isValid
());
delete
m_display
;
m_display
=
nullptr
;
m_compositorInterface
=
nullptr
;
m_seatInterface
=
nullptr
;
QVERIFY
(
connectionDiedSpy
.
wait
());
// now the seat should be destroyed;
QVERIFY
(
!
m_seat
->
isValid
());
// calling destroy again should not fail
m_seat
->
destroy
();
}
QTEST_MAIN
(
TestWaylandSeat
)
#include
"test_wayland_seat.moc"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment