summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-08-01 10:07:16 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-08-01 10:22:55 (GMT)
commit5a15e4df671aac30bba332801528a6283c2e4874 (patch)
tree8668089b7b9db89451b8b06ba7be29056a805f53 /Slimber/UnitTest
parent336aa7d1c0a5aa223a6543d50ee17d82560c2b84 (diff)
downloadswift-5a15e4df671aac30bba332801528a6283c2e4874.zip
swift-5a15e4df671aac30bba332801528a6283c2e4874.tar.bz2
Made Slimber fully functional again.
Diffstat (limited to 'Slimber/UnitTest')
-rw-r--r--Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp b/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp
index f15daf4..f77a8cb 100644
--- a/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp
+++ b/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp
@@ -29,6 +29,8 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
CPPUNIT_TEST(testGetRoster_InfoWithLastName);
CPPUNIT_TEST(testGetRoster_InfoWithFirstAndLastName);
CPPUNIT_TEST(testGetRoster_NoInfo);
+ CPPUNIT_TEST(testGetServiceForJID);
+ CPPUNIT_TEST(testGetServiceForJID_NoMatch);
CPPUNIT_TEST_SUITE_END();
public:
@@ -176,6 +178,27 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(String(""), item->getName());
}
+ void testGetServiceForJID() {
+ std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+
+ addService("alice@wonderland");
+ addService("rabbit@teaparty");
+ addService("queen@garden");
+
+ boost::optional<LinkLocalService> service = testling->getServiceForJID(JID("rabbit@teaparty"));
+ CPPUNIT_ASSERT(service);
+ CPPUNIT_ASSERT_EQUAL(String("rabbit@teaparty"), service->getID().getName());
+ }
+
+ void testGetServiceForJID_NoMatch() {
+ std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+
+ addService("alice@wonderland");
+ addService("queen@garden");
+
+ CPPUNIT_ASSERT(!testling->getServiceForJID(JID("rabbit@teaparty")));
+ }
+
private:
std::auto_ptr<LinkLocalPresenceManager> createTestling() {
std::auto_ptr<LinkLocalPresenceManager> testling(