face: move createChannel overloads that take strings to unit tests
They are used only there.
Change-Id: I0c70221bbcad36024223cc6e3c929b9c08b683c0
diff --git a/tests/daemon/face/websocket-factory.t.cpp b/tests/daemon/face/websocket-factory.t.cpp
index 380646e..d813931 100644
--- a/tests/daemon/face/websocket-factory.t.cpp
+++ b/tests/daemon/face/websocket-factory.t.cpp
@@ -28,13 +28,23 @@
#include "face-system-fixture.hpp"
#include "factory-test-common.hpp"
+#include <ndn-cxx/net/address-converter.hpp>
+
namespace nfd {
namespace face {
namespace tests {
-namespace ip = boost::asio::ip;
-
-using WebSocketFactoryFixture = FaceSystemFactoryFixture<WebSocketFactory>;
+class WebSocketFactoryFixture : public FaceSystemFactoryFixture<WebSocketFactory>
+{
+protected:
+ shared_ptr<WebSocketChannel>
+ createChannel(const std::string& localIp, const std::string& localPort)
+ {
+ websocket::Endpoint endpoint(ndn::ip::addressFromString(localIp),
+ boost::lexical_cast<uint16_t>(localPort));
+ return factory.createChannel(endpoint);
+ }
+};
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestWebSocketFactory, WebSocketFactoryFixture)
@@ -175,9 +185,9 @@
BOOST_CHECK_EQUAL(factory.getChannels().empty(), true);
std::set<std::string> expected;
- expected.insert(factory.createChannel("127.0.0.1", "20070")->getUri().toString());
- expected.insert(factory.createChannel("127.0.0.1", "20071")->getUri().toString());
- expected.insert(factory.createChannel("::1", "20071")->getUri().toString());
+ expected.insert(createChannel("127.0.0.1", "20070")->getUri().toString());
+ expected.insert(createChannel("127.0.0.1", "20071")->getUri().toString());
+ expected.insert(createChannel("::1", "20071")->getUri().toString());
checkChannelListEqual(factory, expected);
}