summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-12-15 17:08:12 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-12-15 17:08:12 (GMT)
commit8e504f4709d15f502ca097f6bf4b27880fd9c6c5 (patch)
tree19e49e1271be2b9a41e31f3a9d241ccb70da88b5 /tests
parent4896b8a5b16c7f91e026e52906c063af204c34be (diff)
parent1bbb6e4db246d7be69a7592e2e700f79d7858d5a (diff)
downloadQt-8e504f4709d15f502ca097f6bf4b27880fd9c6c5.zip
Qt-8e504f4709d15f502ca097f6bf4b27880fd9c6c5.tar.gz
Qt-8e504f4709d15f502ca097f6bf4b27880fd9c6c5.tar.bz2
Merge branch '4.5' into 4.6-staging
Conflicts: mkspecs/macx-g++40/qplatformdefs.h
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qdbuspendingreply/tst_qdbuspendingreply.cpp25
-rw-r--r--tests/auto/qdbusreply/tst_qdbusreply.cpp16
2 files changed, 41 insertions, 0 deletions
diff --git a/tests/auto/qdbuspendingreply/tst_qdbuspendingreply.cpp b/tests/auto/qdbuspendingreply/tst_qdbuspendingreply.cpp
index 6398d9c..82e6389 100644
--- a/tests/auto/qdbuspendingreply/tst_qdbuspendingreply.cpp
+++ b/tests/auto/qdbuspendingreply/tst_qdbuspendingreply.cpp
@@ -93,6 +93,7 @@ private slots:
}
void init();
+ void unconnected();
void simpleTypes();
void complexTypes();
void wrongTypes();
@@ -252,6 +253,30 @@ void tst_QDBusPendingReply::init()
QVERIFY(iface->isValid());
}
+void tst_QDBusPendingReply::unconnected()
+{
+ QDBusConnection con("invalid stored connection");
+ QVERIFY(!con.isConnected());
+ QDBusInterface iface("doesnt.matter", "/", "doesnt.matter", con);
+ QVERIFY(!iface.isValid());
+
+ QDBusPendingReply<> rvoid = iface.asyncCall("ReloadConfig");
+ QVERIFY(rvoid.isFinished());
+ QVERIFY(!rvoid.isValid());
+ QVERIFY(rvoid.isError());
+ rvoid.waitForFinished();
+ QVERIFY(!rvoid.isValid());
+ QVERIFY(rvoid.isError());
+
+ QDBusPendingReply<QString> rstring = iface.asyncCall("GetId");
+ QVERIFY(rstring.isFinished());
+ QVERIFY(!rstring.isValid());
+ QVERIFY(rstring.isError());
+ rstring.waitForFinished();
+ QVERIFY(!rstring.isValid());
+ QVERIFY(rstring.isError());
+}
+
void tst_QDBusPendingReply::simpleTypes()
{
QDBusPendingReply<> rvoid = iface->asyncCall("retrieveVoid");
diff --git a/tests/auto/qdbusreply/tst_qdbusreply.cpp b/tests/auto/qdbusreply/tst_qdbusreply.cpp
index 9866302..e36d288 100644
--- a/tests/auto/qdbusreply/tst_qdbusreply.cpp
+++ b/tests/auto/qdbusreply/tst_qdbusreply.cpp
@@ -93,6 +93,7 @@ private slots:
}
void init();
+ void unconnected();
void simpleTypes();
void complexTypes();
void wrongTypes();
@@ -236,6 +237,21 @@ void tst_QDBusReply::init()
QVERIFY(iface->isValid());
}
+void tst_QDBusReply::unconnected()
+{
+ QDBusConnection con("invalid stored connection");
+ QVERIFY(!con.isConnected());
+ QDBusInterface iface("doesnt.matter", "/", "doesnt.matter", con);
+ QVERIFY(!iface.isValid());
+
+ QDBusReply<void> rvoid = iface.asyncCall("ReloadConfig");
+ QVERIFY(!rvoid.isValid());
+
+ QDBusReply<QString> rstring = iface.asyncCall("GetId");
+ QVERIFY(!rstring.isValid());
+ QVERIFY(rstring.value().isEmpty());
+}
+
void tst_QDBusReply::simpleTypes()
{
QDBusReply<bool> rbool = iface->call(QDBus::BlockWithGui, "retrieveBool");