mirror of
https://invent.kde.org/marcoa/a-la-karte.git
synced 2026-03-26 17:03:08 +00:00
tests: cover Input1 version and capabilities
This commit is contained in:
parent
d254b272fe
commit
13b65135f1
1 changed files with 35 additions and 0 deletions
|
|
@ -91,6 +91,7 @@ private Q_SLOTS:
|
||||||
void pingRunner();
|
void pingRunner();
|
||||||
void runnerVersionAndListRunners();
|
void runnerVersionAndListRunners();
|
||||||
void pingInput();
|
void pingInput();
|
||||||
|
void inputVersionAndCapabilities();
|
||||||
void inputProfilesCrud();
|
void inputProfilesCrud();
|
||||||
void runnerResolveLaunchNative();
|
void runnerResolveLaunchNative();
|
||||||
void runnerGameProfiles();
|
void runnerGameProfiles();
|
||||||
|
|
@ -441,6 +442,40 @@ void DbusSmokeTest::pingInput()
|
||||||
QCOMPARE(reply.value(), QStringLiteral("ok"));
|
QCOMPARE(reply.value(), QStringLiteral("ok"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DbusSmokeTest::inputVersionAndCapabilities()
|
||||||
|
{
|
||||||
|
org::kde::ALaKarte::Input1 iface(QStringLiteral("org.kde.ALaKarte.Input1"), QStringLiteral("/org/kde/ALaKarte/Input1"), m_bus);
|
||||||
|
QVERIFY(iface.isValid());
|
||||||
|
iface.setTimeout(2000);
|
||||||
|
|
||||||
|
{
|
||||||
|
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<QVariantMap> reply = iface.GetCapabilities();
|
||||||
|
reply.waitForFinished();
|
||||||
|
QVERIFY2(!reply.isError(), qPrintable(reply.error().message()));
|
||||||
|
|
||||||
|
const QVariantMap caps = reply.value();
|
||||||
|
QVERIFY(caps.contains(QStringLiteral("supportsBattery")));
|
||||||
|
QVERIFY(caps.value(QStringLiteral("supportsBattery")).canConvert<bool>());
|
||||||
|
QCOMPARE(caps.value(QStringLiteral("supportsBattery")).toBool(), true);
|
||||||
|
|
||||||
|
QVERIFY(caps.contains(QStringLiteral("supportsHotplug")));
|
||||||
|
QVERIFY(caps.value(QStringLiteral("supportsHotplug")).canConvert<bool>());
|
||||||
|
QCOMPARE(caps.value(QStringLiteral("supportsHotplug")).toBool(), true);
|
||||||
|
|
||||||
|
QVERIFY(caps.contains(QStringLiteral("supportsProfiles")));
|
||||||
|
QVERIFY(caps.value(QStringLiteral("supportsProfiles")).canConvert<bool>());
|
||||||
|
QCOMPARE(caps.value(QStringLiteral("supportsProfiles")).toBool(), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DbusSmokeTest::inputProfilesCrud()
|
void DbusSmokeTest::inputProfilesCrud()
|
||||||
{
|
{
|
||||||
org::kde::ALaKarte::Input1 iface(QStringLiteral("org.kde.ALaKarte.Input1"), QStringLiteral("/org/kde/ALaKarte/Input1"), m_bus);
|
org::kde::ALaKarte::Input1 iface(QStringLiteral("org.kde.ALaKarte.Input1"), QStringLiteral("/org/kde/ALaKarte/Input1"), m_bus);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue