mirror of
https://invent.kde.org/marcoa/a-la-karte.git
synced 2026-03-26 17:03:08 +00:00
tests: cover Runner1 version and runner list shape
This commit is contained in:
parent
fe253d89bc
commit
7c9a0c4a89
1 changed files with 36 additions and 0 deletions
|
|
@ -12,6 +12,7 @@
|
|||
#include <QElapsedTimer>
|
||||
#include <QProcess>
|
||||
#include <QProcessEnvironment>
|
||||
#include <QSet>
|
||||
#include <QSignalSpy>
|
||||
#include <QStandardPaths>
|
||||
#include <QStringList>
|
||||
|
|
@ -87,6 +88,7 @@ private Q_SLOTS:
|
|||
void gameCenterPolicyAndCapabilities();
|
||||
void gameCenterLaunchFailureContract();
|
||||
void pingRunner();
|
||||
void runnerVersionAndListRunners();
|
||||
void pingInput();
|
||||
void runnerResolveLaunchNative();
|
||||
void runnerGameProfiles();
|
||||
|
|
@ -391,6 +393,40 @@ void DbusSmokeTest::pingRunner()
|
|||
QCOMPARE(reply.value(), QStringLiteral("ok"));
|
||||
}
|
||||
|
||||
void DbusSmokeTest::runnerVersionAndListRunners()
|
||||
{
|
||||
org::kde::ALaKarte::Runner1 iface(QStringLiteral("org.kde.ALaKarte.Runner1"), QStringLiteral("/org/kde/ALaKarte/Runner1"), m_bus);
|
||||
QVERIFY(iface.isValid());
|
||||
iface.setTimeout(5000);
|
||||
|
||||
{
|
||||
QDBusPendingReply<uint, uint> reply = iface.Version();
|
||||
reply.waitForFinished();
|
||||
QVERIFY2(!reply.isError(), qPrintable(reply.error().message()));
|
||||
QCOMPARE(reply.argumentAt<0>(), 1u);
|
||||
QCOMPARE(reply.argumentAt<1>(), 0u);
|
||||
}
|
||||
|
||||
QDBusPendingReply<QVariantList> reply = iface.ListRunners();
|
||||
reply.waitForFinished();
|
||||
QVERIFY2(!reply.isError(), qPrintable(reply.error().message()));
|
||||
|
||||
const QVariantList list = reply.value();
|
||||
QSet<QString> ids;
|
||||
for (const QVariant &v : list) {
|
||||
const QVariantMap m = unwrapVariantMap(v);
|
||||
const QString id = m.value(QStringLiteral("id")).toString();
|
||||
const QString type = m.value(QStringLiteral("type")).toString();
|
||||
const QString path = m.value(QStringLiteral("path")).toString();
|
||||
|
||||
QVERIFY2(!id.isEmpty(), "runner entry missing id");
|
||||
QVERIFY2(!type.isEmpty(), qPrintable(QStringLiteral("runner '%1' missing type").arg(id)));
|
||||
QVERIFY2(!path.isEmpty(), qPrintable(QStringLiteral("runner '%1' missing path").arg(id)));
|
||||
QVERIFY2(!ids.contains(id), qPrintable(QStringLiteral("duplicate runner id '%1'").arg(id)));
|
||||
ids.insert(id);
|
||||
}
|
||||
}
|
||||
|
||||
void DbusSmokeTest::pingInput()
|
||||
{
|
||||
QDBusInterface iface(QStringLiteral("org.kde.ALaKarte.Input1"),
|
||||
|
|
|
|||
Loading…
Reference in a new issue