tests: add support for link-local addresses in getTestIp

Change-Id: If57cb93f1c25a18b680aef12895ee5924ca90cfa
diff --git a/tests/daemon/face/multicast-udp-transport-fixture.hpp b/tests/daemon/face/multicast-udp-transport-fixture.hpp
index 00a9451..c2b92b2 100644
--- a/tests/daemon/face/multicast-udp-transport-fixture.hpp
+++ b/tests/daemon/face/multicast-udp-transport-fixture.hpp
@@ -47,7 +47,7 @@
   MulticastUdpTransportFixture()
     : transport(nullptr)
     , multicastEp(ip::address::from_string("230.15.19.47"), 7070)
-    , defaultAddr(getTestIp<AddressFamily::V4>(LoopbackAddress::No, MulticastInterface::Yes))
+    , defaultAddr(getTestIp(AddressFamily::V4, AddressScope::Global, MulticastInterface::Yes))
     , receivedPackets(nullptr)
     , remoteSockRx(g_io)
     , remoteSockTx(g_io)
@@ -55,7 +55,7 @@
   }
 
   void
-  initialize(ip::address_v4 address)
+  initialize(ip::address address)
   {
     openMulticastSockets(remoteSockRx, remoteSockTx, multicastEp.port());
 
@@ -119,7 +119,7 @@
   MulticastUdpTransport* transport;
   udp::endpoint localEp;
   udp::endpoint multicastEp;
-  const ip::address_v4 defaultAddr;
+  const ip::address defaultAddr;
   std::vector<Transport::Packet>* receivedPackets;
 
 private:
diff --git a/tests/daemon/face/tcp-channel.t.cpp b/tests/daemon/face/tcp-channel.t.cpp
index 3b5da41..1239b1b 100644
--- a/tests/daemon/face/tcp-channel.t.cpp
+++ b/tests/daemon/face/tcp-channel.t.cpp
@@ -41,7 +41,7 @@
 
 BOOST_AUTO_TEST_CASE_TEMPLATE(ConnectTimeout, F, AddressFamilies)
 {
-  auto address = getTestIp<F::value>(LoopbackAddress::Yes);
+  auto address = getTestIp(F::value, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address);
   // do not listen
 
diff --git a/tests/daemon/face/tcp-transport.t.cpp b/tests/daemon/face/tcp-transport.t.cpp
index bf04b63..dd3de57 100644
--- a/tests/daemon/face/tcp-transport.t.cpp
+++ b/tests/daemon/face/tcp-transport.t.cpp
@@ -36,7 +36,7 @@
 
 BOOST_AUTO_TEST_CASE(StaticPropertiesLocalIpv4)
 {
-  auto address = getTestIp<AddressFamily::V4>(LoopbackAddress::Yes);
+  auto address = getTestIp(AddressFamily::V4, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address);
   initialize(address);
 
@@ -52,7 +52,7 @@
 
 BOOST_AUTO_TEST_CASE(StaticPropertiesLocalIpv6)
 {
-  auto address = getTestIp<AddressFamily::V6>(LoopbackAddress::Yes);
+  auto address = getTestIp(AddressFamily::V6, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address);
   initialize(address);
 
@@ -68,7 +68,7 @@
 
 BOOST_AUTO_TEST_CASE(StaticPropertiesNonLocalIpv4)
 {
-  auto address = getTestIp<AddressFamily::V4>(LoopbackAddress::No);
+  auto address = getTestIp(AddressFamily::V4, AddressScope::Global);
   SKIP_IF_IP_UNAVAILABLE(address);
   initialize(address);
 
@@ -86,7 +86,7 @@
 
 BOOST_AUTO_TEST_CASE(StaticPropertiesNonLocalIpv6)
 {
-  auto address = getTestIp<AddressFamily::V6>(LoopbackAddress::No);
+  auto address = getTestIp(AddressFamily::V6, AddressScope::Global);
   SKIP_IF_IP_UNAVAILABLE(address);
   initialize(address);
 
@@ -104,7 +104,7 @@
 
 BOOST_AUTO_TEST_CASE(PersistencyChange)
 {
-  auto address = getTestIp<AddressFamily::V4>();
+  auto address = getTestIp(AddressFamily::V4);
   SKIP_IF_IP_UNAVAILABLE(address);
   initialize(address);
 
@@ -115,7 +115,7 @@
 
 BOOST_AUTO_TEST_CASE(PermanentReconnect)
 {
-  auto address = getTestIp<AddressFamily::V4>();
+  auto address = getTestIp(AddressFamily::V4);
   SKIP_IF_IP_UNAVAILABLE(address);
   initialize(address, ndn::nfd::FACE_PERSISTENCY_PERMANENT);
 
@@ -140,7 +140,7 @@
   // when persistency is changed out of permanent while transport is DOWN,
   // the transport immediately goes into FAILED state
 
-  auto address = getTestIp<AddressFamily::V4>();
+  auto address = getTestIp(AddressFamily::V4);
   SKIP_IF_IP_UNAVAILABLE(address);
   initialize(address, ndn::nfd::FACE_PERSISTENCY_PERMANENT);
 
@@ -206,7 +206,7 @@
 
 BOOST_AUTO_TEST_CASE(PermanentReconnectWithExponentialBackoff)
 {
-  auto address = getTestIp<AddressFamily::V4>();
+  auto address = getTestIp(AddressFamily::V4);
   SKIP_IF_IP_UNAVAILABLE(address);
 
   tcp::endpoint remoteEp(address, 7070);
diff --git a/tests/daemon/face/tcp-udp-channel.t.cpp b/tests/daemon/face/tcp-udp-channel.t.cpp
index e568bd6..bac8d88 100644
--- a/tests/daemon/face/tcp-udp-channel.t.cpp
+++ b/tests/daemon/face/tcp-udp-channel.t.cpp
@@ -73,7 +73,7 @@
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(MultipleAccepts, T, FixtureAndAddressList, T::Fixture)
 {
-  auto address = getTestIp<T::ADDRESS_FAMILY>(LoopbackAddress::Yes);
+  auto address = getTestIp(T::ADDRESS_FAMILY, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address);
   this->listen(address);
 
@@ -125,7 +125,7 @@
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(FaceClosure, T, FixtureAndAddressList, T::Fixture)
 {
-  auto address = getTestIp<T::ADDRESS_FAMILY>(LoopbackAddress::Yes);
+  auto address = getTestIp(T::ADDRESS_FAMILY, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address);
   this->listen(address);
 
diff --git a/tests/daemon/face/test-netif-ip.cpp b/tests/daemon/face/test-netif-ip.cpp
index 3471ba3..82f4b89 100644
--- a/tests/daemon/face/test-netif-ip.cpp
+++ b/tests/daemon/face/test-netif-ip.cpp
@@ -25,6 +25,7 @@
 
 #include "test-netif-ip.hpp"
 #include "core/global-io.hpp"
+
 #include <ndn-cxx/net/network-monitor.hpp>
 
 namespace nfd {
@@ -56,67 +57,37 @@
   return cached;
 }
 
-namespace {
-
 template<typename E>
-bool
+static bool
 matchTristate(E e, bool b)
 {
-  return (e == E::DontCare) ||
+  return (e == E::Unspecified) ||
          (e == E::Yes && b) ||
          (e == E::No && !b);
 }
 
-template<AddressFamily AF>
-typename IpAddressFromFamily<AF>::type
-fromIpAddress(const boost::asio::ip::address& a);
-
-template<>
-IpAddressFromFamily<AddressFamily::V4>::type
-fromIpAddress<AddressFamily::V4>(const boost::asio::ip::address& a)
-{
-  return a.to_v4();
-}
-
-template<>
-IpAddressFromFamily<AddressFamily::V6>::type
-fromIpAddress<AddressFamily::V6>(const boost::asio::ip::address& a)
-{
-  return a.to_v6();
-}
-
-} // unnamed namespace
-
-template<AddressFamily AF>
-typename IpAddressFromFamily<AF>::type
-getTestIp(LoopbackAddress loopback, MulticastInterface mcast)
+boost::asio::ip::address
+getTestIp(AddressFamily family, AddressScope scope, MulticastInterface mcast)
 {
   for (const auto& interface : collectNetworkInterfaces()) {
     if (!interface->isUp() ||
-        !matchTristate(loopback, interface->isLoopback()) ||
         !matchTristate(mcast, interface->canMulticast())) {
       continue;
     }
     for (const auto& address : interface->getNetworkAddresses()) {
-      if (isAddressFamily<AF>(address) &&
-          !address.getIp().is_unspecified() &&
-          address.getScope() != ndn::net::AddressScope::NOWHERE &&
-          address.getScope() != ndn::net::AddressScope::LINK && // link-local addresses are not supported yet (#1428)
-          matchTristate(loopback, address.getIp().is_loopback())) {
-        return fromIpAddress<AF>(address.getIp());
+      if (!address.getIp().is_unspecified() &&
+          (family == AddressFamily::UNSPECIFIED ||
+           family == address.getFamily()) &&
+          (scope == AddressScope::Unspecified ||
+           static_cast<int>(scope) == static_cast<int>(address.getScope())) &&
+          (scope != AddressScope::Loopback ||
+           address.getIp().is_loopback())) {
+        return address.getIp();
       }
     }
   }
   return {};
 }
 
-template
-IpAddressFromFamily<AddressFamily::V4>::type
-getTestIp<AddressFamily::V4>(LoopbackAddress loopback, MulticastInterface mcast);
-
-template
-IpAddressFromFamily<AddressFamily::V6>::type
-getTestIp<AddressFamily::V6>(LoopbackAddress loopback, MulticastInterface mcast);
-
 } // namespace tests
 } // namespace nfd
diff --git a/tests/daemon/face/test-netif-ip.hpp b/tests/daemon/face/test-netif-ip.hpp
index dc076d7..239bc82 100644
--- a/tests/daemon/face/test-netif-ip.hpp
+++ b/tests/daemon/face/test-netif-ip.hpp
@@ -27,9 +27,8 @@
 #define NFD_TESTS_DAEMON_FACE_TEST_NETIF_IP_HPP
 
 #include "core/common.hpp"
-#include <type_traits>
-#include <boost/asio/ip/address_v4.hpp>
-#include <boost/asio/ip/address_v6.hpp>
+
+#include <boost/asio/ip/address.hpp>
 #include <ndn-cxx/net/network-address.hpp>
 #include <ndn-cxx/net/network-interface.hpp>
 
@@ -52,33 +51,25 @@
 
 template<AddressFamily AF>
 bool
-isAddressFamily(const NetworkAddress& a)
-{
-  return a.getFamily() == AF;
-}
-
-template<AddressFamily AF>
-bool
 hasAddressFamily(const NetworkInterface& netif)
 {
   return std::any_of(netif.getNetworkAddresses().begin(), netif.getNetworkAddresses().end(),
-                     &isAddressFamily<AF>);
+                     [] (const NetworkAddress& a) { return a.getFamily() == AF; });
 }
 
 // ---- IP address ----
 
-enum class LoopbackAddress {
-  No,
-  Yes,
-  DontCare,
-  Default = Yes
+enum class AddressScope {
+  Loopback  = static_cast<int>(ndn::net::AddressScope::HOST),
+  LinkLocal = static_cast<int>(ndn::net::AddressScope::LINK),
+  Global    = static_cast<int>(ndn::net::AddressScope::GLOBAL),
+  Unspecified
 };
 
 enum class MulticastInterface {
   No,
   Yes,
-  DontCare,
-  Default = DontCare
+  Unspecified
 };
 
 /** \brief Derives IP address type from AddressFamily
@@ -99,32 +90,24 @@
 };
 
 /** \brief Get an IP address from any available network interface
- *  \tparam F address family, either AddressFamily::V4 or AddressFamily::V6
- *  \param loopback specifies if the address can, must, or must not be a loopback address
+ *  \param family the desired address family
+ *  \param scope the desired address scope
  *  \param mcast specifies if the address can, must, or must not be chosen from a multicast-capable interface
  *  \return an IP address, either boost::asio::ip::address_v4 or boost::asio::ip::address_v6
  *  \retval unspecified address, if no appropriate address is available
  */
-template<AddressFamily F>
-typename IpAddressFromFamily<F>::type
-getTestIp(LoopbackAddress loopback = LoopbackAddress::Default,
-          MulticastInterface mcast = MulticastInterface::Default);
+boost::asio::ip::address
+getTestIp(AddressFamily family = AddressFamily::UNSPECIFIED,
+          AddressScope scope = AddressScope::Unspecified,
+          MulticastInterface mcast = MulticastInterface::Unspecified);
 
-extern template
-IpAddressFromFamily<AddressFamily::V4>::type
-getTestIp<AddressFamily::V4>(LoopbackAddress loopback, MulticastInterface mcast);
-
-extern template
-IpAddressFromFamily<AddressFamily::V6>::type
-getTestIp<AddressFamily::V6>(LoopbackAddress loopback, MulticastInterface mcast);
-
-/** \brief Skip rest of the test case if \p address is unavailable
+/** \brief Skip the rest of the test case if \p address is unavailable
  *
- *  This macro can be used in conjunction with \p nfd::tests::getTestIp in a test case. Example:
+ *  This macro can be used in conjunction with nfd::tests::getTestIp in a test case. Example:
  *  \code
  *  BOOST_AUTO_TEST_CASE(TestCase)
  *  {
- *    auto ip = getTestIp<AddressFamily::V4>();
+ *    auto ip = getTestIp(AddressFamily::V4);
  *    SKIP_IF_IP_UNAVAILABLE(ip);
  *    // Test something that requires an IPv4 address.
  *  }
diff --git a/tests/daemon/face/unicast-udp-transport-fixture.hpp b/tests/daemon/face/unicast-udp-transport-fixture.hpp
index ef8f588..f3c5165 100644
--- a/tests/daemon/face/unicast-udp-transport-fixture.hpp
+++ b/tests/daemon/face/unicast-udp-transport-fixture.hpp
@@ -47,7 +47,7 @@
   UnicastUdpTransportFixture()
     : transport(nullptr)
     , remoteSocket(g_io)
-    , defaultAddr(getTestIp<AddressFamily::V4>())
+    , defaultAddr(getTestIp(AddressFamily::V4, AddressScope::Loopback))
     , receivedPackets(nullptr)
   {
   }
diff --git a/tests/daemon/face/unicast-udp-transport.t.cpp b/tests/daemon/face/unicast-udp-transport.t.cpp
index abb3a58..e66dc8b 100644
--- a/tests/daemon/face/unicast-udp-transport.t.cpp
+++ b/tests/daemon/face/unicast-udp-transport.t.cpp
@@ -36,7 +36,7 @@
 
 BOOST_AUTO_TEST_CASE(StaticPropertiesLocalIpv4)
 {
-  auto address = getTestIp<AddressFamily::V4>(LoopbackAddress::Yes);
+  auto address = getTestIp(AddressFamily::V4, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address);
   initialize(address);
 
@@ -52,7 +52,7 @@
 
 BOOST_AUTO_TEST_CASE(StaticPropertiesLocalIpv6)
 {
-  auto address = getTestIp<AddressFamily::V6>(LoopbackAddress::Yes);
+  auto address = getTestIp(AddressFamily::V6, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address);
   initialize(address);
 
@@ -68,7 +68,7 @@
 
 BOOST_AUTO_TEST_CASE(StaticPropertiesNonLocalIpv4)
 {
-  auto address = getTestIp<AddressFamily::V4>(LoopbackAddress::No);
+  auto address = getTestIp(AddressFamily::V4, AddressScope::Global);
   SKIP_IF_IP_UNAVAILABLE(address);
   initialize(address);
 
@@ -86,7 +86,7 @@
 
 BOOST_AUTO_TEST_CASE(StaticPropertiesNonLocalIpv6)
 {
-  auto address = getTestIp<AddressFamily::V6>(LoopbackAddress::No);
+  auto address = getTestIp(AddressFamily::V6, AddressScope::Global);
   SKIP_IF_IP_UNAVAILABLE(address);
   initialize(address);
 
@@ -104,7 +104,7 @@
 
 BOOST_AUTO_TEST_CASE(PersistencyChange)
 {
-  auto address = getTestIp<AddressFamily::V4>();
+  auto address = getTestIp(AddressFamily::V4);
   SKIP_IF_IP_UNAVAILABLE(address);
   initialize(address);
 
@@ -115,7 +115,7 @@
 
 BOOST_AUTO_TEST_CASE(ExpirationTime)
 {
-  auto address = getTestIp<AddressFamily::V4>();
+  auto address = getTestIp(AddressFamily::V4);
   SKIP_IF_IP_UNAVAILABLE(address);
   initialize(address, ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
   BOOST_CHECK_NE(transport->getExpirationTime(), time::steady_clock::TimePoint::max());
@@ -129,7 +129,7 @@
 
 BOOST_AUTO_TEST_CASE(IdleClose)
 {
-  auto address = getTestIp<AddressFamily::V4>();
+  auto address = getTestIp(AddressFamily::V4);
   SKIP_IF_IP_UNAVAILABLE(address);
   initialize(address, ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
 
@@ -162,7 +162,7 @@
 
 BOOST_AUTO_TEST_CASE_TEMPLATE(RemoteClose, Persistency, RemoteClosePersistencies)
 {
-  auto address = getTestIp<AddressFamily::V4>();
+  auto address = getTestIp(AddressFamily::V4, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address);
   initialize(address, Persistency::value);
 
@@ -188,7 +188,7 @@
 
 BOOST_AUTO_TEST_CASE(RemoteClosePermanent)
 {
-  auto address = getTestIp<AddressFamily::V4>();
+  auto address = getTestIp(AddressFamily::V4, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address);
   initialize(address, ndn::nfd::FACE_PERSISTENCY_PERMANENT);
 
diff --git a/tests/daemon/face/websocket-channel.t.cpp b/tests/daemon/face/websocket-channel.t.cpp
index a714291..5c1a60d 100644
--- a/tests/daemon/face/websocket-channel.t.cpp
+++ b/tests/daemon/face/websocket-channel.t.cpp
@@ -182,7 +182,7 @@
 
 BOOST_AUTO_TEST_CASE(MultipleAccepts)
 {
-  auto address = getTestIp<AddressFamily::V4>(LoopbackAddress::Yes);
+  auto address = getTestIp(AddressFamily::V4, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address);
   this->listen(address);
 
@@ -213,7 +213,7 @@
 
 BOOST_AUTO_TEST_CASE(Send)
 {
-  auto address = getTestIp<AddressFamily::V4>(LoopbackAddress::Yes);
+  auto address = getTestIp(AddressFamily::V4, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address);
   this->initialize(address);
   auto transport = listenerFaces.front()->getTransport();
@@ -241,7 +241,7 @@
 
 BOOST_AUTO_TEST_CASE(Receive)
 {
-  auto address = getTestIp<AddressFamily::V4>(LoopbackAddress::Yes);
+  auto address = getTestIp(AddressFamily::V4, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address);
   this->initialize(address);
 
@@ -265,7 +265,7 @@
 
 BOOST_AUTO_TEST_CASE(FaceClosure)
 {
-  auto address = getTestIp<AddressFamily::V4>(LoopbackAddress::Yes);
+  auto address = getTestIp(AddressFamily::V4, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address);
   this->initialize(address);
 
@@ -275,7 +275,7 @@
 
 BOOST_AUTO_TEST_CASE(RemoteClose)
 {
-  auto address = getTestIp<AddressFamily::V4>(LoopbackAddress::Yes);
+  auto address = getTestIp(AddressFamily::V4, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address);
   this->initialize(address);
 
@@ -288,7 +288,7 @@
 BOOST_AUTO_TEST_CASE(SetPingInterval)
 {
   const time::milliseconds pingInterval(800);
-  auto address = getTestIp<AddressFamily::V4>(LoopbackAddress::Yes);
+  auto address = getTestIp(AddressFamily::V4, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address);
   this->initialize(address, pingInterval, time::milliseconds(1000));
 
@@ -300,7 +300,7 @@
 
 BOOST_AUTO_TEST_CASE(SetPongTimeOut)
 {
-  auto address = getTestIp<AddressFamily::V4>(LoopbackAddress::Yes);
+  auto address = getTestIp(AddressFamily::V4, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address);
   this->initialize(address, time::milliseconds(500), time::milliseconds(300));
   clientShouldPong = false;
diff --git a/tests/daemon/face/websocket-transport.t.cpp b/tests/daemon/face/websocket-transport.t.cpp
index c974802..6336bef 100644
--- a/tests/daemon/face/websocket-transport.t.cpp
+++ b/tests/daemon/face/websocket-transport.t.cpp
@@ -227,7 +227,7 @@
 
 BOOST_AUTO_TEST_CASE(StaticPropertiesLocalIpv4)
 {
-  auto address = getTestIp<AddressFamily::V4>(LoopbackAddress::Yes);
+  auto address = getTestIp(AddressFamily::V4, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address);
   ip::tcp::endpoint ep(address, 20070);
   this->endToEndInitialize(ep);
@@ -244,7 +244,7 @@
 
 BOOST_AUTO_TEST_CASE(StaticPropertiesNonLocalIpv4)
 {
-  auto address = getTestIp<AddressFamily::V4>(LoopbackAddress::No);
+  auto address = getTestIp(AddressFamily::V4, AddressScope::Global);
   SKIP_IF_IP_UNAVAILABLE(address);
   ip::tcp::endpoint ep(address, 20070);
   this->endToEndInitialize(ep);
@@ -261,9 +261,9 @@
 
 BOOST_AUTO_TEST_CASE(StaticPropertiesLocalIpv4MappedIpv6)
 {
-  auto address4 = getTestIp<AddressFamily::V4>(LoopbackAddress::Yes);
+  auto address4 = getTestIp(AddressFamily::V4, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address4);
-  auto address6 = ip::address_v6::v4_mapped(address4);
+  auto address6 = ip::address_v6::v4_mapped(address4.to_v4());
   BOOST_REQUIRE(address6.is_v4_mapped());
   ip::tcp::endpoint ep(address6, 20070);
   this->endToEndInitialize(ep);
@@ -280,7 +280,7 @@
 
 BOOST_AUTO_TEST_CASE(PersistencyChange)
 {
-  auto address = getTestIp<AddressFamily::V4>();
+  auto address = getTestIp(AddressFamily::V4);
   SKIP_IF_IP_UNAVAILABLE(address);
   this->endToEndInitialize(ip::tcp::endpoint(address, 20070));
 
@@ -291,7 +291,7 @@
 
 BOOST_AUTO_TEST_CASE(PingPong)
 {
-  auto address = getTestIp<AddressFamily::V4>();
+  auto address = getTestIp(AddressFamily::V4);
   SKIP_IF_IP_UNAVAILABLE(address);
   this->endToEndInitialize(ip::tcp::endpoint(address, 20070),
                            time::milliseconds(500), time::milliseconds(300));
@@ -316,7 +316,7 @@
 
 BOOST_AUTO_TEST_CASE(Send)
 {
-  auto address = getTestIp<AddressFamily::V4>();
+  auto address = getTestIp(AddressFamily::V4);
   SKIP_IF_IP_UNAVAILABLE(address);
   this->endToEndInitialize(ip::tcp::endpoint(address, 20070));
 
@@ -343,7 +343,7 @@
 
 BOOST_AUTO_TEST_CASE(ReceiveNormal)
 {
-  auto address = getTestIp<AddressFamily::V4>();
+  auto address = getTestIp(AddressFamily::V4);
   SKIP_IF_IP_UNAVAILABLE(address);
   this->endToEndInitialize(ip::tcp::endpoint(address, 20070));
 
@@ -365,7 +365,7 @@
 
 BOOST_AUTO_TEST_CASE(ReceiveMalformed)
 {
-  auto address = getTestIp<AddressFamily::V4>();
+  auto address = getTestIp(AddressFamily::V4);
   SKIP_IF_IP_UNAVAILABLE(address);
   this->endToEndInitialize(ip::tcp::endpoint(address, 20070));
 
@@ -391,7 +391,7 @@
 
 BOOST_AUTO_TEST_CASE(Close)
 {
-  auto address = getTestIp<AddressFamily::V4>();
+  auto address = getTestIp(AddressFamily::V4);
   SKIP_IF_IP_UNAVAILABLE(address);
   this->endToEndInitialize(ip::tcp::endpoint(address, 20070));
 
@@ -419,7 +419,7 @@
 
 BOOST_AUTO_TEST_CASE(RemoteClose)
 {
-  auto address = getTestIp<AddressFamily::V4>();
+  auto address = getTestIp(AddressFamily::V4);
   SKIP_IF_IP_UNAVAILABLE(address);
   this->endToEndInitialize(ip::tcp::endpoint(address, 20070));