diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-07-30 22:25:50 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-07-30 22:25:50 (GMT) |
commit | 387a3193b648f40f499895c0c03b982c2f8d1263 (patch) | |
tree | 3eb5c1142a9937299e2267da5d32146457f10077 /Swiften/LinkLocal/UnitTest | |
parent | ba113b63e5ee8e76638ae8f02f7220fb1b8fcdce (diff) | |
download | swift-387a3193b648f40f499895c0c03b982c2f8d1263.zip swift-387a3193b648f40f499895c0c03b982c2f8d1263.tar.bz2 |
Added unit test that triggers the assertion on self service removal.
Diffstat (limited to 'Swiften/LinkLocal/UnitTest')
-rw-r--r-- | Swiften/LinkLocal/UnitTest/LinkLocalServiceBrowserTest.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Swiften/LinkLocal/UnitTest/LinkLocalServiceBrowserTest.cpp b/Swiften/LinkLocal/UnitTest/LinkLocalServiceBrowserTest.cpp index 76117c0..9f91269 100644 --- a/Swiften/LinkLocal/UnitTest/LinkLocalServiceBrowserTest.cpp +++ b/Swiften/LinkLocal/UnitTest/LinkLocalServiceBrowserTest.cpp @@ -22,6 +22,7 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { CPPUNIT_TEST(testServiceAdded_UnregisteredService); CPPUNIT_TEST(testServiceChanged); CPPUNIT_TEST(testServiceRemoved); + CPPUNIT_TEST(testServiceRemoved_UnregisteredService); CPPUNIT_TEST(testError_BrowseErrorAfterStart); CPPUNIT_TEST(testError_BrowseErrorAfterResolve); CPPUNIT_TEST(testRegisterService); @@ -154,6 +155,23 @@ class LinkLocalServiceBrowserTest : public CppUnit::TestFixture { testling->stop(); } + void testServiceRemoved_UnregisteredService() { + boost::shared_ptr<LinkLocalServiceBrowser> testling = createTestling(); + testling->start(); + eventLoop->processEvents(); + testling->registerService("alice", 1234, LinkLocalServiceInfo()); + eventLoop->processEvents(); + testling->unregisterService(); + eventLoop->processEvents(); + + querier->removeService(*aliceServiceID); + eventLoop->processEvents(); + + CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(removedServices.size())); + + testling->stop(); + } + void testServiceChanged() { boost::shared_ptr<LinkLocalServiceBrowser> testling = createTestling(); testling->start(); |