summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp')
-rw-r--r--Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp b/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp
index c8e7700..b1a51c9 100644
--- a/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp
+++ b/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp
@@ -1,11 +1,11 @@
/*
- * Copyright (c) 2010-2016 Isode Limited.
+ * Copyright (c) 2010-2018 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <map>
#include <boost/bind.hpp>
#include <cppunit/extensions/HelperMacros.h>
@@ -219,35 +219,39 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
return testling;
}
void addService(const std::string& name, const std::string& nickName = std::string(), const std::string& firstName = std::string(), const std::string& lastName = std::string()) {
DNSSDServiceID service(name, "local.");
LinkLocalServiceInfo info;
info.setFirstName(firstName);
info.setLastName(lastName);
info.setNick(nickName);
- querier->setServiceInfo(service, DNSSDResolveServiceQuery::Result(name + "._presence._tcp.local", "rabbithole.local", 1234, info.toTXTRecord()));
+ auto txtRecord = info.toTXTRecord();
+ CPPUNIT_ASSERT(txtRecord);
+ querier->setServiceInfo(service, DNSSDResolveServiceQuery::Result(name + "._presence._tcp.local", "rabbithole.local", 1234, *txtRecord));
querier->addService(service);
eventLoop->processEvents();
}
void removeService(const std::string& name) {
DNSSDServiceID service(name, "local.");
querier->removeService(DNSSDServiceID(name, "local."));
eventLoop->processEvents();
}
void updateServicePresence(const std::string& name, LinkLocalServiceInfo::Status status, const std::string& message) {
DNSSDServiceID service(name, "local.");
LinkLocalServiceInfo info;
info.setStatus(status);
info.setMessage(message);
- querier->setServiceInfo(service, DNSSDResolveServiceQuery::Result(name + "._presence._tcp.local", "rabbithole.local", 1234, info.toTXTRecord()));
+ auto txtRecord = info.toTXTRecord();
+ CPPUNIT_ASSERT(txtRecord);
+ querier->setServiceInfo(service, DNSSDResolveServiceQuery::Result(name + "._presence._tcp.local", "rabbithole.local", 1234, *txtRecord));
eventLoop->processEvents();
}
void handleRosterChanged(std::shared_ptr<RosterPayload> payload) {
rosterChanges.push_back(payload);
}
void handlePresenceChanged(std::shared_ptr<Presence> presence) {
presenceChanges.push_back(presence);