You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
5 years ago
|
/*
|
||
|
SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
|
||
8 years ago
|
|
||
5 years ago
|
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
||
|
*/
|
||
8 years ago
|
// Qt
|
||
1 year ago
|
#include <QSignalSpy>
|
||
|
#include <QTest>
|
||
8 years ago
|
// WaylandServer
|
||
2 years ago
|
#include "wayland/display.h"
|
||
8 years ago
|
|
||
1 year ago
|
using namespace KWin;
|
||
8 years ago
|
|
||
|
class NoXdgRuntimeDirTest : public QObject
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
private Q_SLOTS:
|
||
|
void initTestCase();
|
||
|
void testCreate();
|
||
|
};
|
||
|
|
||
|
void NoXdgRuntimeDirTest::initTestCase()
|
||
|
{
|
||
|
qunsetenv("XDG_RUNTIME_DIR");
|
||
|
}
|
||
|
|
||
|
void NoXdgRuntimeDirTest::testCreate()
|
||
|
{
|
||
|
// this test verifies that not having an XDG_RUNTIME_DIR is handled gracefully
|
||
|
// the server cannot start, but should not crash
|
||
|
const QString testSocketName = QStringLiteral("kwayland-test-no-xdg-runtime-dir-0");
|
||
1 year ago
|
KWin::Display display;
|
||
|
QSignalSpy runningSpy(&display, &KWin::Display::runningChanged);
|
||
4 years ago
|
QVERIFY(!display.addSocketName(testSocketName));
|
||
8 years ago
|
display.start();
|
||
|
|
||
|
// call into dispatchEvents should not crash
|
||
|
display.dispatchEvents();
|
||
|
}
|
||
|
|
||
|
QTEST_GUILESS_MAIN(NoXdgRuntimeDirTest)
|
||
|
#include "test_no_xdg_runtime_dir.moc"
|