2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2016-06-01 08:21:19 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
|
2016-06-01 08:21:19 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2018-06-05 10:52:57 +00:00
|
|
|
#include <QtTest>
|
2016-06-01 08:21:19 +00:00
|
|
|
#include <QLoggingCategory>
|
2022-03-09 16:25:44 +00:00
|
|
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
|
|
#include <private/qtx11extras_p.h>
|
|
|
|
#else
|
2016-06-01 08:21:19 +00:00
|
|
|
#include <QX11Info>
|
2022-03-09 16:25:44 +00:00
|
|
|
#endif
|
2016-06-01 08:21:19 +00:00
|
|
|
|
2016-09-08 13:08:45 +00:00
|
|
|
#include "../testutils.h"
|
2021-02-09 18:18:36 +00:00
|
|
|
|
|
|
|
#include "kwinxrenderutils.h"
|
2016-06-01 08:21:19 +00:00
|
|
|
|
|
|
|
class BlendPictureTest : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
private Q_SLOTS:
|
|
|
|
void initTestCase();
|
|
|
|
void cleanupTestCase();
|
|
|
|
|
|
|
|
void testDontCrashOnTeardown();
|
|
|
|
};
|
|
|
|
|
|
|
|
void BlendPictureTest::initTestCase()
|
|
|
|
{
|
|
|
|
KWin::XRenderUtils::init(QX11Info::connection(), QX11Info::appRootWindow());
|
|
|
|
}
|
|
|
|
|
|
|
|
void BlendPictureTest::cleanupTestCase()
|
|
|
|
{
|
|
|
|
KWin::XRenderUtils::cleanup();
|
|
|
|
}
|
|
|
|
|
|
|
|
void BlendPictureTest::testDontCrashOnTeardown()
|
|
|
|
{
|
|
|
|
// this test uses xrenderBlendPicture - the only idea is to trigger the creation
|
|
|
|
// closing the application should not crash
|
|
|
|
// see BUG 363251
|
|
|
|
const auto picture = KWin::xRenderBlendPicture(0.5);
|
|
|
|
// and a second one
|
|
|
|
const auto picture2 = KWin::xRenderBlendPicture(0.6);
|
|
|
|
Q_UNUSED(picture)
|
|
|
|
Q_UNUSED(picture2)
|
|
|
|
}
|
|
|
|
|
2016-09-08 13:08:45 +00:00
|
|
|
Q_CONSTRUCTOR_FUNCTION(forceXcb)
|
2016-06-01 08:21:19 +00:00
|
|
|
QTEST_MAIN(BlendPictureTest)
|
|
|
|
#include "blendpicture_test.moc"
|