summaryrefslogtreecommitdiffstats
path: root/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp
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/qdbusabstractadaptor/qmyserver/qmyserver.cpp
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/qdbusabstractadaptor/qmyserver/qmyserver.cpp')
-rw-r--r--tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp
index b0b9889e70..b4a79fa754 100644
--- a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp
+++ b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp
@@ -44,7 +44,7 @@ QString valueSpy;
Q_DECLARE_METATYPE(QDBusConnection::RegisterOptions)
-class MyServer : public QDBusServer
+class MyServer : public QDBusServer, protected QDBusContext
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.qtproject.autotests.qmyserver")
@@ -67,6 +67,8 @@ public:
public slots:
QString address() const
{
+ if (!QDBusServer::isConnected())
+ sendErrorReply(QDBusServer::lastError().name(), QDBusServer::lastError().message());
return QDBusServer::address();
}