summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/LinkLocal/UnitTest/MockDNSSDService.h')
-rw-r--r--Swiften/LinkLocal/UnitTest/MockDNSSDService.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/Swiften/LinkLocal/UnitTest/MockDNSSDService.h b/Swiften/LinkLocal/UnitTest/MockDNSSDService.h
index 56661ee..69ac06d 100644
--- a/Swiften/LinkLocal/UnitTest/MockDNSSDService.h
+++ b/Swiften/LinkLocal/UnitTest/MockDNSSDService.h
@@ -6,6 +6,7 @@
#include "Swiften/EventLoop/MainEventLoop.h"
#include "Swiften/LinkLocal/DNSSDService.h"
+#include "Swiften/LinkLocal/DNSSDServiceFactory.h"
namespace Swift {
class MockDNSSDService : public DNSSDService {
@@ -78,5 +79,19 @@ namespace Swift {
std::vector<LinkLocalServiceID> resolvingServices;
};
+ class MockDNSSDServiceFactory : public DNSSDServiceFactory {
+ public:
+ boost::shared_ptr<DNSSDService> createDNSSDService() {
+ boost::shared_ptr<MockDNSSDService> result(new MockDNSSDService());
+ services.push_back(result);
+ return result;
+ }
+
+ bool canCreate() const {
+ return true;
+ }
+
+ std::vector<boost::shared_ptr<MockDNSSDService> > services;
+ };
}