diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-11-08 16:35:00 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-11-08 16:35:00 (GMT) |
commit | 7623cf03a68d5c071b06cf50d23e393a37265d95 (patch) | |
tree | b9c594e053e1602fc6c38fbcb424160f73f9b9f5 /tests | |
parent | 6cc5e911a3afa2fab5b44d113a9bf2fa2720ab79 (diff) | |
download | Qt-7623cf03a68d5c071b06cf50d23e393a37265d95.zip Qt-7623cf03a68d5c071b06cf50d23e393a37265d95.tar.gz Qt-7623cf03a68d5c071b06cf50d23e393a37265d95.tar.bz2 |
Autotest: prevent race-condition from causing a test failure.
The test requires receiving the NameOwnerChanged signal from the bus
before the voidSignal we emit ourselves. For whatever reason, the bus
apparently delays the emission of that signal, which could cause our
signal to be received first.
We should actually wait for the signal, but a simple processEvents is
enough in my tests.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp index 91050f5..a2c4758 100644 --- a/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp +++ b/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp @@ -133,7 +133,7 @@ tst_QDBusAbstractInterface::tst_QDBusAbstractInterface() void tst_QDBusAbstractInterface::initTestCase() { // enable debugging temporarily: - putenv("QDBUS_DEBUG=1"); + //putenv("QDBUS_DEBUG=1"); // register the object QDBusConnection con = QDBusConnection::sessionBus(); @@ -465,6 +465,7 @@ void tst_QDBusAbstractInterface::followSignal() QDBusConnectionInterface::DontAllowReplacement); QVERIFY(r.isValid() && r.value() == QDBusConnectionInterface::ServiceRegistered); QVERIFY(con.interface()->isServiceRegistered(serviceToFollow)); + QCoreApplication::instance()->processEvents(); // emit the signal again: emit targetObj.voidSignal(); |