summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp')
-rw-r--r--tests/auto/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/auto/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp b/tests/auto/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp
index c70c619..5d08c63 100644
--- a/tests/auto/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp
+++ b/tests/auto/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp
@@ -609,19 +609,22 @@ void tst_QDBusAbstractAdaptor::methodCalls()
QVERIFY(con.isConnected());
//QDBusInterface emptycon.baseService(), "/", QString());
- QDBusInterface if1(con.baseService(), "/", "local.Interface1", con);
- QDBusInterface if2(con.baseService(), "/", "local.Interface2", con);
- QDBusInterface if3(con.baseService(), "/", "local.Interface3", con);
- QDBusInterface if4(con.baseService(), "/", "local.Interface4", con);
- // must fail: no object
- //QCOMPARE(empty->call("method").type(), QDBusMessage::ErrorMessage);
- QCOMPARE(if1.call(QDBus::BlockWithGui, "method").type(), QDBusMessage::ErrorMessage);
+ {
+ // must fail: no object
+ QDBusInterface if1(con.baseService(), "/", "local.Interface1", con);
+ QCOMPARE(if1.call(QDBus::BlockWithGui, "method").type(), QDBusMessage::ErrorMessage);
+ }
QFETCH(int, nInterfaces);
MyObject obj(nInterfaces);
con.registerObject("/", &obj);
+ QDBusInterface if1(con.baseService(), "/", "local.Interface1", con);
+ QDBusInterface if2(con.baseService(), "/", "local.Interface2", con);
+ QDBusInterface if3(con.baseService(), "/", "local.Interface3", con);
+ QDBusInterface if4(con.baseService(), "/", "local.Interface4", con);
+
// must fail: no such method
QCOMPARE(if1.call(QDBus::BlockWithGui, "method").type(), QDBusMessage::ErrorMessage);
if (!nInterfaces--)
@@ -670,11 +673,11 @@ void tst_QDBusAbstractAdaptor::methodCallScriptable()
QDBusConnection con = QDBusConnection::sessionBus();
QVERIFY(con.isConnected());
- QDBusInterface if2(con.baseService(), "/", "local.Interface2", con);
-
MyObject obj(2);
con.registerObject("/", &obj);
+ QDBusInterface if2(con.baseService(), "/", "local.Interface2", con);
+
QCOMPARE(if2.call(QDBus::BlockWithGui,"scriptableMethod").type(), QDBusMessage::ReplyMessage);
QCOMPARE(slotSpy, "void Interface2::scriptableMethod()");
}