summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-11-20 08:30:24 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-11-20 08:30:31 (GMT)
commit3e5d4bcbcd6a4bdf0bfd6ae5933a61293720656a (patch)
tree3c19344f403677d43f495f879acc648089e68492 /tests
parentea0f526ac3a7daef5d4ebff2373a01d4088e28c3 (diff)
parentb345b96dc14cc0da3a9ff44216d447e6f2c8ad97 (diff)
downloadQt-3e5d4bcbcd6a4bdf0bfd6ae5933a61293720656a.zip
Qt-3e5d4bcbcd6a4bdf0bfd6ae5933a61293720656a.tar.gz
Qt-3e5d4bcbcd6a4bdf0bfd6ae5933a61293720656a.tar.bz2
Merge commit 'b345b96dc14cc0da3a9ff44216d447e6f2c8ad97' from oslo-staging-1 into 4.6
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qdbusservicewatcher/tst_qdbusservicewatcher.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/auto/qdbusservicewatcher/tst_qdbusservicewatcher.cpp b/tests/auto/qdbusservicewatcher/tst_qdbusservicewatcher.cpp
index 10b43b1..ac0f806 100644
--- a/tests/auto/qdbusservicewatcher/tst_qdbusservicewatcher.cpp
+++ b/tests/auto/qdbusservicewatcher/tst_qdbusservicewatcher.cpp
@@ -47,12 +47,13 @@ class tst_QDBusServiceWatcher: public QObject
{
Q_OBJECT
QString serviceName;
+ int testCounter;
public:
tst_QDBusServiceWatcher();
private slots:
void initTestCase();
- void cleanup();
+ void init();
void watchForCreation();
void watchForDisappearance();
@@ -61,7 +62,7 @@ private slots:
};
tst_QDBusServiceWatcher::tst_QDBusServiceWatcher()
- : serviceName("com.example.TestName")
+ : testCounter(0)
{
}
@@ -71,10 +72,10 @@ void tst_QDBusServiceWatcher::initTestCase()
QVERIFY(con.isConnected());
}
-void tst_QDBusServiceWatcher::cleanup()
+void tst_QDBusServiceWatcher::init()
{
- // ensure that the name isn't registered
- QDBusConnection::sessionBus().unregisterService(serviceName);
+ // change the service name from test to test
+ serviceName = "com.example.TestService" + QString::number(testCounter++);
}
void tst_QDBusServiceWatcher::watchForCreation()
@@ -135,6 +136,7 @@ void tst_QDBusServiceWatcher::watchForDisappearance()
QVERIFY(con.isConnected());
QDBusServiceWatcher watcher(serviceName, con, QDBusServiceWatcher::WatchForUnregistration);
+ watcher.setObjectName("watcher for disappearance");
QSignalSpy spyR(&watcher, SIGNAL(serviceRegistered(QString)));
QSignalSpy spyU(&watcher, SIGNAL(serviceUnregistered(QString)));