aboutsummaryrefslogtreecommitdiff
path: root/libcontextprovider/customer-tests/service/servicetest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcontextprovider/customer-tests/service/servicetest.cpp')
-rw-r--r--libcontextprovider/customer-tests/service/servicetest.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/libcontextprovider/customer-tests/service/servicetest.cpp b/libcontextprovider/customer-tests/service/servicetest.cpp
index c27b80ac..378f6bbf 100644
--- a/libcontextprovider/customer-tests/service/servicetest.cpp
+++ b/libcontextprovider/customer-tests/service/servicetest.cpp
@@ -179,14 +179,25 @@ void ServiceTest::multiStart()
QString expected = "Subscribe returned: Unknown";
QCOMPARE(actual.simplified(), expected.simplified());
+ // Start listening to signals (we already have one subscriber)
+ QSignalSpy firstSpy(property,
+ SIGNAL(firstSubscriberAppeared(const QString&)));
+ QSignalSpy lastSpy(property,
+ SIGNAL(firstSubscriberAppeared(const QString&)));
+
// Test: start the service again (even though it's started)
service->start();
// Expected result: the service is still there, and remembers the client
actual = writeToClient("subscribe service Test.Property\n");
- expected = "Subscribe error: org.maemo.contextkit.Error.MultipleSubscribe";
+ expected = "Subscribe returned: Unknown";
QCOMPARE(actual.simplified(), expected.simplified());
+ // (so we don't get a signal)
+ QTest::qWait(1000);
+ QCOMPARE(firstSpy.count(), 0);
+ QCOMPARE(lastSpy.count(), 0);
+
delete service;
delete property;
}