diff options
Diffstat (limited to 'tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp')
-rw-r--r-- | tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp index 5f3cf539e9..91e69fcdb7 100644 --- a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp +++ b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp @@ -47,13 +47,13 @@ #include <QtDBus> #include "interface.h" -#include "pinger.h" +#include "pinger_interface.h" static const char serviceName[] = "org.qtproject.autotests.qpinger"; static const char objectPath[] = "/org/qtproject/qpinger"; static const char *interfaceName = serviceName; -typedef QSharedPointer<com::trolltech::QtDBus::Pinger> Pinger; +typedef QSharedPointer<org::qtproject::QtDBus::Pinger> Pinger; class tst_QDBusAbstractInterface: public QObject { @@ -67,7 +67,7 @@ class tst_QDBusAbstractInterface: public QObject return Pinger(); if (service.isEmpty() && !service.isNull()) service = con.baseService(); - return Pinger(new com::trolltech::QtDBus::Pinger(service, path, con)); + return Pinger(new org::qtproject::QtDBus::Pinger(service, path, con)); } Pinger getPingerPeer(const QString &path = "/", const QString &service = "") @@ -75,7 +75,7 @@ class tst_QDBusAbstractInterface: public QObject QDBusConnection con = QDBusConnection("peer"); if (!con.isConnected()) return Pinger(); - return Pinger(new com::trolltech::QtDBus::Pinger(service, path, con)); + return Pinger(new org::qtproject::QtDBus::Pinger(service, path, con)); } void resetServer() @@ -308,14 +308,22 @@ void tst_QDBusAbstractInterface::makeStringCall() QCOMPARE(r.value(), targetObj.stringMethod()); } +static QHash<QString, QVariant> complexMethodArgs() +{ + QHash<QString, QVariant> args; + args.insert("arg1", "Hello world"); + args.insert("arg2", 12345); + return args; +} + void tst_QDBusAbstractInterface::makeComplexCall() { Pinger p = getPinger(); QVERIFY2(p, "Not connected to D-Bus"); - QDBusReply<RegisteredType> r = p->complexMethod(); + QDBusReply<RegisteredType> r = p->complexMethod(complexMethodArgs()); QVERIFY(r.isValid()); - QCOMPARE(r.value(), targetObj.complexMethod()); + QCOMPARE(r.value(), targetObj.complexMethod(complexMethodArgs())); } void tst_QDBusAbstractInterface::makeMultiOutCall() @@ -356,9 +364,9 @@ void tst_QDBusAbstractInterface::makeComplexCallPeer() Pinger p = getPingerPeer(); QVERIFY2(p, "Not connected to D-Bus"); - QDBusReply<RegisteredType> r = p->complexMethod(); + QDBusReply<RegisteredType> r = p->complexMethod(complexMethodArgs()); QVERIFY(r.isValid()); - QCOMPARE(r.value(), targetObj.complexMethod()); + QCOMPARE(r.value(), targetObj.complexMethod(complexMethodArgs())); } void tst_QDBusAbstractInterface::makeMultiOutCallPeer() @@ -401,10 +409,10 @@ void tst_QDBusAbstractInterface::makeAsyncComplexCall() Pinger p = getPinger(); QVERIFY2(p, "Not connected to D-Bus"); - QDBusPendingReply<RegisteredType> r = p->complexMethod(); + QDBusPendingReply<RegisteredType> r = p->complexMethod(complexMethodArgs()); r.waitForFinished(); QVERIFY(r.isValid()); - QCOMPARE(r.value(), targetObj.complexMethod()); + QCOMPARE(r.value(), targetObj.complexMethod(complexMethodArgs())); } void tst_QDBusAbstractInterface::makeAsyncMultiOutCall() @@ -449,10 +457,10 @@ void tst_QDBusAbstractInterface::makeAsyncComplexCallPeer() Pinger p = getPingerPeer(); QVERIFY2(p, "Not connected to D-Bus"); - QDBusPendingReply<RegisteredType> r = p->complexMethod(); + QDBusPendingReply<RegisteredType> r = p->complexMethod(complexMethodArgs()); r.waitForFinished(); QVERIFY(r.isValid()); - QCOMPARE(r.value(), targetObj.complexMethod()); + QCOMPARE(r.value(), targetObj.complexMethod(complexMethodArgs())); } void tst_QDBusAbstractInterface::makeAsyncMultiOutCallPeer() @@ -551,7 +559,7 @@ void tst_QDBusAbstractInterface::callWithTimeout() } // Now using generated code - com::trolltech::QtDBus::Pinger p(server_serviceName, server_objectPath, QDBusConnection::sessionBus()); + org::qtproject::QtDBus::Pinger p(server_serviceName, server_objectPath, QDBusConnection::sessionBus()); { // Call with no timeout QDBusReply<int> reply = p.sleepMethod(100); |