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.
This commit is contained in:
Martin Gräßlin 2016-04-26 12:47:02 +02:00
parent 8b2e032f96
commit 6d60f01ad9
2 changed files with 8 additions and 3 deletions

View file

@ -70,6 +70,9 @@ private:
void DontCrashEmptyDecorationTest::initTestCase()
{
if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) {
QSKIP("Needs a dri device");
}
qRegisterMetaType<KWin::ShellClient*>();
qRegisterMetaType<KWin::AbstractClient*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);

View file

@ -97,9 +97,11 @@ void WaylandServer::terminateClientConnections()
{
destroyInternalConnection();
destroyInputMethodConnection();
const auto connections = m_display->connections();
for (auto it = connections.begin(); it != connections.end(); ++it) {
(*it)->destroy();
if (m_display) {
const auto connections = m_display->connections();
for (auto it = connections.begin(); it != connections.end(); ++it) {
(*it)->destroy();
}
}
}