Commit 6d60f01a authored by Martin Flöser's avatar Martin Flöser

Skip DontCrashEmptyDecorationTest if we don't have a /dev/dri/card0 device

Without the /dev/dri/card0 mesa fails to initialize egl and the test
fails. In order to silence the failure till the system provides the
device file, we better skip the test.

A nullptr crash in that case is fixed in WaylandServer tear-down.
parent 8b2e032f
...@@ -70,6 +70,9 @@ private: ...@@ -70,6 +70,9 @@ private:
void DontCrashEmptyDecorationTest::initTestCase() void DontCrashEmptyDecorationTest::initTestCase()
{ {
if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) {
QSKIP("Needs a dri device");
}
qRegisterMetaType<KWin::ShellClient*>(); qRegisterMetaType<KWin::ShellClient*>();
qRegisterMetaType<KWin::AbstractClient*>(); qRegisterMetaType<KWin::AbstractClient*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
......
...@@ -97,10 +97,12 @@ void WaylandServer::terminateClientConnections() ...@@ -97,10 +97,12 @@ void WaylandServer::terminateClientConnections()
{ {
destroyInternalConnection(); destroyInternalConnection();
destroyInputMethodConnection(); destroyInputMethodConnection();
if (m_display) {
const auto connections = m_display->connections(); const auto connections = m_display->connections();
for (auto it = connections.begin(); it != connections.end(); ++it) { for (auto it = connections.begin(); it != connections.end(); ++it) {
(*it)->destroy(); (*it)->destroy();
} }
}
} }
void WaylandServer::init(const QByteArray &socketName, InitalizationFlags flags) void WaylandServer::init(const QByteArray &socketName, InitalizationFlags flags)
......
Markdown is supported
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