summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp')
-rw-r--r--Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp b/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp
index a1ecdf8..f15daf4 100644
--- a/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp
+++ b/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp
@@ -18,6 +18,7 @@ using namespace Swift;
class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(LinkLocalPresenceManagerTest);
+ CPPUNIT_TEST(testConstructor);
CPPUNIT_TEST(testServiceAdded);
CPPUNIT_TEST(testServiceRemoved);
CPPUNIT_TEST(testServiceChanged);
@@ -31,8 +32,6 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE_END();
public:
- LinkLocalPresenceManagerTest() {}
-
void setUp() {
eventLoop = new DummyEventLoop();
querier = boost::shared_ptr<FakeDNSSDQuerier>(new FakeDNSSDQuerier("wonderland.lit"));
@@ -46,6 +45,15 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
delete eventLoop;
}
+ void testConstructor() {
+ addService("alice@wonderland");
+ addService("rabbit@teaparty");
+ std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+
+ CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(testling->getRoster()->getItems().size()));
+ CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(testling->getAllPresence().size()));
+ }
+
void testServiceAdded() {
std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());