aboutsummaryrefslogtreecommitdiff
path: root/libcontextprovider/customer-tests/service/servicetest.cpp
diff options
context:
space:
mode:
authorMarja Hassinen <marja.hassinen@nokia.com>2010-12-07 11:59:21 +0200
committerMarja Hassinen <marja.hassinen@nokia.com>2010-12-07 11:59:21 +0200
commit2381c773b9f42af4c9722f231526d3fdfc8cb108 (patch)
tree2c97739143a1ce034efaf46a3e739d6d5d2acc85 /libcontextprovider/customer-tests/service/servicetest.cpp
parent27683eb820ba61a2f36aa50b2ffe77874d617492 (diff)
provider: "Multiple subscribe" and "unsubscribe without subscribe" are no longer errors.boottimewarnings
Sending these messages does no actual harm; the intention of the client is clear. "Multiple subscribe" can actually happen when the provider is not running when the subscriber starts. Contextkit recovers from that situation, and treating "multiple subscribe" as an error provides little value.
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;
}