From 57d1e6e13050efb41875cae08db96d1de51499f0 Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Sat, 14 Feb 2026 13:07:51 +0100 Subject: [PATCH] tests: cover GameCenter unique DBus service behavior --- tests/dbus_smoketest.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/dbus_smoketest.cpp b/tests/dbus_smoketest.cpp index b3aaaa6..c45e92c 100644 --- a/tests/dbus_smoketest.cpp +++ b/tests/dbus_smoketest.cpp @@ -79,6 +79,7 @@ private Q_SLOTS: void cleanupTestCase(); void pingGameCenter(); + void gameCenterUniqueness(); void pingRunner(); void pingInput(); void runnerResolveLaunchNative(); @@ -243,6 +244,34 @@ void DbusSmokeTest::pingGameCenter() QCOMPARE(reply.value(), QStringLiteral("ok")); } +void DbusSmokeTest::gameCenterUniqueness() +{ + pingGameCenter(); + + QVERIFY(m_bus.interface()); + const QDBusReply ownerBeforeReply = m_bus.interface()->serviceOwner(QStringLiteral("org.kde.GameCenter1")); + QVERIFY(ownerBeforeReply.isValid()); + const QString ownerBefore = ownerBeforeReply.value(); + QVERIFY(!ownerBefore.isEmpty()); + + QProcess second; + startDaemon(second, m_gamecenterPath); + QVERIFY(second.waitForStarted(5000)); + + const bool finished = second.waitForFinished(5000); + if (!finished) { + stopProcess(second); + } + QVERIFY(finished); + QCOMPARE(second.exitStatus(), QProcess::NormalExit); + + const QDBusReply ownerAfterReply = m_bus.interface()->serviceOwner(QStringLiteral("org.kde.GameCenter1")); + QVERIFY(ownerAfterReply.isValid()); + QCOMPARE(ownerAfterReply.value(), ownerBefore); + + pingGameCenter(); +} + void DbusSmokeTest::pingRunner() { QDBusInterface iface(QStringLiteral("org.kde.ALaKarte.Runner1"),