summaryrefslogtreecommitdiffstats
path: root/tests/auto/dbus/qdbusinterface
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-12-11 14:39:22 -0800
committerThiago Macieira <thiago.macieira@intel.com>2014-12-20 07:36:52 +0100
commit91fe8129fa54847b8d4146672d561349633aea79 (patch)
tree4c17db4ea8dd537e74b1e0622bc00abe33cf03e9 /tests/auto/dbus/qdbusinterface
parent7b6ab50c68e771ecbd350b58890fae0e58330e9f (diff)
Autotest: Make the peer executables report error if they failed
QDBusServer::address() will return an empty QString, which caused the tests to fail later with no apparent reason. Change-Id: I86f448dfc67a6cdb27ecda2d490f335766cfaf4f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests/auto/dbus/qdbusinterface')
-rw-r--r--tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp b/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp
index cb7296e7d2..4aacbdc5a2 100644
--- a/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp
+++ b/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp
@@ -42,7 +42,7 @@ static const char objectPath[] = "/org/qtproject/qmyserver";
int MyObject::callCount = 0;
QVariantList MyObject::callArgs;
-class MyServer : public QDBusServer
+class MyServer : public QDBusServer, protected QDBusContext
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.qtproject.autotests.qmyserver")
@@ -58,6 +58,8 @@ public:
public slots:
QString address() const
{
+ if (!QDBusServer::isConnected())
+ sendErrorReply(QDBusServer::lastError().name(), QDBusServer::lastError().message());
return QDBusServer::address();
}