summaryrefslogtreecommitdiff
path: root/qt4/tests
diff options
context:
space:
mode:
Diffstat (limited to 'qt4/tests')
-rw-r--r--qt4/tests/dbus/chan-basics.cpp19
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()