diff options
author | Andre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk> | 2011-09-22 19:23:24 -0300 |
---|---|---|
committer | Andre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk> | 2011-09-23 20:17:48 -0300 |
commit | 9ed3de80f0dd01919ce77aab2a32e7035a8f1fe8 (patch) | |
tree | 6780ebedc6e857206a486398da36555d87e87821 /qt4/tests | |
parent | 95066cf285d78d779fdcb9b7362520c33b516c84 (diff) |
chan-basics test: Check that the channel is correctly invalid when creating a channel from an invalid connection.
Diffstat (limited to 'qt4/tests')
-rw-r--r-- | qt4/tests/dbus/chan-basics.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/qt4/tests/dbus/chan-basics.cpp b/qt4/tests/dbus/chan-basics.cpp index 5b15a2e37..7f578a57e 100644 --- a/qt4/tests/dbus/chan-basics.cpp +++ b/qt4/tests/dbus/chan-basics.cpp @@ -7,8 +7,10 @@ #define TP_QT4_ENABLE_LOWLEVEL_API #include <TelepathyQt4/Channel> +#include <TelepathyQt4/ChannelFactory> #include <TelepathyQt4/Connection> #include <TelepathyQt4/ConnectionLowlevel> +#include <TelepathyQt4/ContactFactory> #include <TelepathyQt4/PendingChannel> #include <TelepathyQt4/PendingHandles> #include <TelepathyQt4/PendingReady> @@ -139,6 +141,23 @@ void TestChanBasics::testCreateChannel() << QLatin1String("alice"); toCheck.sort(); QCOMPARE(ids, toCheck); + + ChannelPtr chan = Channel::create(mConn->client(), mChan->objectPath(), + mChan->immutableProperties()); + QVERIFY(chan); + QVERIFY(chan->isValid()); + + // create an invalid connection to use as the channel connection + ConnectionPtr conn = Connection::create(QLatin1String(""), QLatin1String("/"), + ChannelFactory::create(QDBusConnection::sessionBus()), + ContactFactory::create()); + QVERIFY(conn); + QVERIFY(!conn->isValid()); + + chan = Channel::create(conn, mChan->objectPath(), + mChan->immutableProperties()); + QVERIFY(chan); + QVERIFY(!chan->isValid()); } void TestChanBasics::testEnsureChannel() |