[Telepathy-commits] [telepathy-qt4/master] Connection: Added more tests to isReady/becomeReady functionality.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Sat Jan 24 18:21:12 PST 2009


---
 tests/pinocchio/conn-basics.cpp |   41 ++++++++++++++++++++++++++++++++------
 1 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/tests/pinocchio/conn-basics.cpp b/tests/pinocchio/conn-basics.cpp
index 33d293c..f8631df 100644
--- a/tests/pinocchio/conn-basics.cpp
+++ b/tests/pinocchio/conn-basics.cpp
@@ -189,6 +189,13 @@ void TestConnBasics::testConnect()
     QVERIFY(disconnect(mConn, SIGNAL(readinessChanged(uint)),
           this, SLOT(expectNotYetConnected(uint))));
 
+    QVERIFY(connect(mConn->becomeReady(),
+            SIGNAL(finished(Telepathy::Client::PendingOperation*)),
+            this,
+            SLOT(expectSuccessfulCall(Telepathy::Client::PendingOperation*))));
+    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()";
@@ -209,6 +216,33 @@ void TestConnBasics::testConnect()
           this, SLOT(expectReady(uint))));
 
     QCOMPARE(mConn->readiness(), Connection::ReadinessFull);
+    QVERIFY(connect(mConn->becomeReady(Connection::FeatureAliasing),
+            SIGNAL(finished(Telepathy::Client::PendingOperation*)),
+            this,
+            SLOT(expectSuccessfulCall(Telepathy::Client::PendingOperation*))));
+    QCOMPARE(mLoop->exec(), 0);
+
+    QVERIFY(connect(mConn->becomeReady(Connection::FeaturePresence),
+            SIGNAL(finished(Telepathy::Client::PendingOperation*)),
+            this,
+            SLOT(expectSuccessfulCall(Telepathy::Client::PendingOperation*))));
+    QCOMPARE(mLoop->exec(), 0);
+
+    QVERIFY(connect(mConn->becomeReady(Connection::FeatureSimplePresence),
+            SIGNAL(finished(Telepathy::Client::PendingOperation*)),
+            this,
+            SLOT(expectSuccessfulCall(Telepathy::Client::PendingOperation*))));
+    QCOMPARE(mLoop->exec(), 0);
+
+    QVERIFY(connect(mConn->becomeReady(Connection::FeatureAliasing | Connection::FeaturePresence | Connection::FeatureSimplePresence),
+            SIGNAL(finished(Telepathy::Client::PendingOperation*)),
+            this,
+            SLOT(expectSuccessfulCall(Telepathy::Client::PendingOperation*))));
+    QCOMPARE(mLoop->exec(), 0);
+    QCOMPARE(mConn->isReady(Connection::FeatureAliasing), true);
+    QCOMPARE(mConn->isReady(Connection::FeaturePresence), true);
+    QCOMPARE(mConn->isReady(Connection::FeatureSimplePresence), false);
+
     QCOMPARE(static_cast<uint>(mConn->status()),
         static_cast<uint>(Telepathy::ConnectionStatusConnected));
     QCOMPARE(static_cast<uint>(mConn->statusReason()),
@@ -222,13 +256,6 @@ void TestConnBasics::testConnect()
     QVERIFY(interfaces.contains(QLatin1String(
             TELEPATHY_INTERFACE_CONNECTION_INTERFACE_CAPABILITIES)));
 
-    QVERIFY(connect(mConn->becomeReady(),
-            SIGNAL(finished(Telepathy::Client::PendingOperation*)),
-            this,
-            SLOT(expectSuccessfulCall(Telepathy::Client::PendingOperation*))));
-    QCOMPARE(mLoop->exec(), 0);
-    QCOMPARE(mConn->isReady(), true);
-
     QVERIFY(connect(mConn->requestDisconnect(),
           SIGNAL(finished(Telepathy::Client::PendingOperation*)),
           this,
-- 
1.5.6.5




More information about the Telepathy-commits mailing list