summaryrefslogtreecommitdiffstats
path: root/tests/auto/dbus/qdbusabstractadaptor/qmyserver
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-10-28 19:05:43 -0700
committerThiago Macieira <thiago.macieira@intel.com>2014-10-31 03:57:24 +0100
commit5368e44a86a4e0d4582ff5268986ea8bd0fa64ca (patch)
tree5db0f302444c274b20f2a9fc79075d45236e4cec /tests/auto/dbus/qdbusabstractadaptor/qmyserver
parentd0ed6dc1464bd4b62b765060901de708eec5687d (diff)
Autotest: synchronize with the peer before emitting more signals
Several of the unit tests request that the peer emit more than one signal, but only handle one. The rest of the signals stay queued in the socket and will be delivered at the next test, causing it to fail often. This doesn't happen in the tests with the bus. There, we don't receive the extraneous signals due to AddMatch/ReceiveMatch on each signal individually and the synchronous nature of the emission (the signals have already been emitted by the next AddMatch and cannot match it). Task-number: QTBUG-42145 Change-Id: I743a0553074972042fca46b76db5d9e7b3209620 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Diffstat (limited to 'tests/auto/dbus/qdbusabstractadaptor/qmyserver')
-rw-r--r--tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp
index 5263d431d0..b4c16c6fa3 100644
--- a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp
+++ b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp
@@ -75,6 +75,11 @@ public slots:
return m_conn.isConnected();
}
+ Q_NOREPLY void requestSync(const QString &seq)
+ {
+ emit syncReceived(seq);
+ }
+
void emitSignal(const QString& interface, const QString& name, const QDBusVariant& parameter)
{
if (interface.endsWith('2'))
@@ -126,10 +131,14 @@ public slots:
valueSpy.clear();
}
+signals:
+ Q_SCRIPTABLE void syncReceived(const QString &sequence);
+
private slots:
- void handleConnection(const QDBusConnection& con)
+ void handleConnection(QDBusConnection con)
{
m_conn = con;
+ con.registerObject(objectPath, this, QDBusConnection::ExportScriptableSignals);
}
private: