[Telepathy-commits] [telepathy-qt4/master] Connection: Changed tests to use Connection::requestConnect instead of baseInterface::Connect.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Sun Jan 25 12:22:31 PST 2009


---
 tests/dbus/handles.cpp          |    3 ++-
 tests/pinocchio/chan-basics.cpp |   11 +++++------
 tests/pinocchio/conn-basics.cpp |   29 +++++++++++++++--------------
 tests/pinocchio/handles.cpp     |   10 ++++------
 4 files changed, 26 insertions(+), 27 deletions(-)

diff --git a/tests/dbus/handles.cpp b/tests/dbus/handles.cpp
index 2e47ae5..441ca01 100644
--- a/tests/dbus/handles.cpp
+++ b/tests/dbus/handles.cpp
@@ -154,7 +154,8 @@ void TestHandles::init()
 
     mConn = new Connection(mConnName, mConnPath);
 
-    mConn->baseInterface()->Connect();
+    mConn->requestConnect();
+
     QVERIFY(connect(mConn, SIGNAL(statusChanged(uint, uint)),
                 this, SLOT(expectConnReady(uint, uint))));
     QCOMPARE(mLoop->exec(), 0);
diff --git a/tests/pinocchio/chan-basics.cpp b/tests/pinocchio/chan-basics.cpp
index 3e1180f..6381448 100644
--- a/tests/pinocchio/chan-basics.cpp
+++ b/tests/pinocchio/chan-basics.cpp
@@ -105,14 +105,13 @@ void TestChanBasics::initTestCase()
 
     // Get a connected Connection
     mConn = new Connection(mConnBusName, mConnObjectPath);
-    Q_ASSERT(mConn->baseInterface() != 0);
 
-    QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(
-            mConn->baseInterface()->Connect());
-    QVERIFY(connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
-            this, SLOT(expectSuccessfulCall(QDBusPendingCallWatcher*))));
+    qDebug() << "calling Connect()";
+    QVERIFY(connect(mConn->requestConnect(),
+            SIGNAL(finished(Telepathy::Client::PendingOperation*)),
+            this,
+            SLOT(expectSuccessfulCall(Telepathy::Client::PendingOperation*))));
     QCOMPARE(mLoop->exec(), 0);
-    delete watcher;
 
     QVERIFY(connect(mConn, SIGNAL(statusChanged(uint, uint)),
           this, SLOT(expectConnReady(uint, uint))));
diff --git a/tests/pinocchio/conn-basics.cpp b/tests/pinocchio/conn-basics.cpp
index 8737845..c5cc0c1 100644
--- a/tests/pinocchio/conn-basics.cpp
+++ b/tests/pinocchio/conn-basics.cpp
@@ -145,15 +145,12 @@ void TestConnBasics::testConnect()
     QCOMPARE(mLoop->exec(), 0);
     QCOMPARE(mConn->isReady(), true);
 
-    // FIXME: should have convenience API so we don't have to use
-    // baseInterface directly
     qDebug() << "calling Connect()";
-    QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(
-            mConn->baseInterface()->Connect());
-    QVERIFY(connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
-            this, SLOT(expectSuccessfulCall(QDBusPendingCallWatcher*))));
+    QVERIFY(connect(mConn->requestConnect(),
+            SIGNAL(finished(Telepathy::Client::PendingOperation*)),
+            this,
+            SLOT(expectSuccessfulCall(Telepathy::Client::PendingOperation*))));
     QCOMPARE(mLoop->exec(), 0);
-    delete watcher;
 
     // Wait for readiness to reach Full
 
@@ -224,15 +221,19 @@ void TestConnBasics::testAlreadyConnected()
 {
     mConn = new Connection(mConnBusName, mConnObjectPath);
 
-    // FIXME: should have convenience API so we don't have to use
-    // baseInterface directly
+    QVERIFY(connect(mConn->becomeReady(),
+            SIGNAL(finished(Telepathy::Client::PendingOperation*)),
+            this,
+            SLOT(expectSuccessfulCall(Telepathy::Client::PendingOperation*))));
+    QCOMPARE(mLoop->exec(), 0);
+    QCOMPARE(mConn->isReady(), true);
+
     qDebug() << "calling Connect()";
-    QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(
-            mConn->baseInterface()->Connect());
-    QVERIFY(connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
-            this, SLOT(expectSuccessfulCall(QDBusPendingCallWatcher*))));
+    QVERIFY(connect(mConn->requestConnect(),
+            SIGNAL(finished(Telepathy::Client::PendingOperation*)),
+            this,
+            SLOT(expectSuccessfulCall(Telepathy::Client::PendingOperation*))));
     QCOMPARE(mLoop->exec(), 0);
-    delete watcher;
 
     // Wait for readiness to reach Full
 
diff --git a/tests/pinocchio/handles.cpp b/tests/pinocchio/handles.cpp
index 6c944ec..e86b2e0 100644
--- a/tests/pinocchio/handles.cpp
+++ b/tests/pinocchio/handles.cpp
@@ -114,13 +114,11 @@ void TestHandles::initTestCase()
     mConn2 = new Connection(privateBus, busName, objectPath);
 
     // Connecting one connects them all
-    Q_ASSERT(mConn1a->baseInterface() != 0);
-    QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(
-            mConn1a->baseInterface()->Connect());
-    QVERIFY(connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
-                this, SLOT(expectSuccessfulCall(QDBusPendingCallWatcher*))));
+    QVERIFY(connect(mConn1a->requestConnect(),
+            SIGNAL(finished(Telepathy::Client::PendingOperation*)),
+            this,
+            SLOT(expectSuccessfulCall(Telepathy::Client::PendingOperation*))));
     QCOMPARE(mLoop->exec(), 0);
-    delete watcher;
 
     Connection *connections[3] = {mConn1a, mConn1b, mConn2};
     for (int i = 0; i < 3; ++i) {
-- 
1.5.6.5




More information about the Telepathy-commits mailing list