summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-12-17 09:40:52 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-12-17 09:40:52 (GMT)
commitdd678f7564955112b348a2fec56b29a8875e585e (patch)
treed2415d20cb5a27c312150cd6ee93bce8d5129895 /tests
parent7d6af0213ab4f8797f98d0beb659fcf2f78a361b (diff)
parentbc01bb10da23d0d2308cf02a16947be836bc9a21 (diff)
downloadQt-dd678f7564955112b348a2fec56b29a8875e585e.zip
Qt-dd678f7564955112b348a2fec56b29a8875e585e.tar.gz
Qt-dd678f7564955112b348a2fec56b29a8875e585e.tar.bz2
Merge remote branch 'staging/4.6' into 4.6
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qdbuspendingreply/tst_qdbuspendingreply.cpp25
-rw-r--r--tests/auto/qdbusreply/tst_qdbusreply.cpp16
-rw-r--r--tests/auto/selftests/tst_selftests.cpp6
3 files changed, 44 insertions, 3 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");
diff --git a/tests/auto/selftests/tst_selftests.cpp b/tests/auto/selftests/tst_selftests.cpp
index 579f4eb..ed3b08e 100644
--- a/tests/auto/selftests/tst_selftests.cpp
+++ b/tests/auto/selftests/tst_selftests.cpp
@@ -182,12 +182,12 @@ void tst_Selftests::runSubTest_data()
#endif
QTest::newRow("benchlibeventcounter") << "benchlibeventcounter" << QStringList("-eventcounter");
QTest::newRow("benchliboptions") << "benchliboptions" << QStringList("-eventcounter");
- QTest::newRow("benchlibwalltime") << "benchlibwalltime" << QStringList();
- //### This test is affected by the speed of the CPU and whether the tick counter is
- //### monotonically increasing. It won't work on some machines so leave it off by default.
+ //### These tests are affected by timing and whether the CPU tick counter is
+ //### monotonically increasing. They won't work on some machines so leave them off by default.
//### Feel free to uncomment for your own testing.
#if 0
+ QTest::newRow("benchlibwalltime") << "benchlibwalltime" << QStringList();
QTest::newRow("benchlibtickcounter") << "benchlibtickcounter" << QStringList("-tickcounter");
#endif