summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp')
-rw-r--r--tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp
index ad1a1b8..58bfabc 100644
--- a/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp
+++ b/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp
@@ -84,6 +84,8 @@ private slots:
void sendArgument_data();
void sendArgument();
+ void sendErrors();
+
private:
QProcess proc;
};
@@ -782,5 +784,28 @@ void tst_QDBusMarshall::sendArgument()
QCOMPARE(extracted, value);
}
+void tst_QDBusMarshall::sendErrors()
+{
+ QDBusConnection con = QDBusConnection::sessionBus();
+
+ QVERIFY(con.isConnected());
+ QDBusMessage msg = QDBusMessage::createSignal("/foo", "local.interfaceName",
+ "signalName");
+ msg << qVariantFromValue(QDBusObjectPath());
+
+ QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal path \"/foo\" interface \"local.interfaceName\" member \"signalName\"");
+ QVERIFY(!con.send(msg));
+
+ msg.setArguments(QVariantList());
+ QDBusObjectPath path;
+
+ QTest::ignoreMessage(QtWarningMsg, "QDBusObjectPath: invalid path \"abc\"");
+ path.setPath("abc");
+ msg << qVariantFromValue(path);
+
+ QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal path \"/foo\" interface \"local.interfaceName\" member \"signalName\"");
+ QVERIFY(!con.send(msg));
+}
+
QTEST_MAIN(tst_QDBusMarshall)
#include "tst_qdbusmarshall.moc"