Refactor and modernize namespace declarations
Move all unit tests to namespace nfd::tests
Delete unused header core/algorithm.hpp
Change-Id: I5591f0c5f3bb5db67f8b45fae95471f8a555ca68
diff --git a/tests/daemon/face/unicast-udp-transport-fixture.hpp b/tests/daemon/face/unicast-udp-transport-fixture.hpp
index ce9006d..e7fb76d 100644
--- a/tests/daemon/face/unicast-udp-transport-fixture.hpp
+++ b/tests/daemon/face/unicast-udp-transport-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,24 +33,15 @@
#include "tests/daemon/limited-io.hpp"
#include "tests/daemon/face/dummy-link-service.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
namespace ip = boost::asio::ip;
using ip::udp;
+using face::UnicastUdpTransport;
class UnicastUdpTransportFixture : public GlobalIoFixture
{
protected:
- UnicastUdpTransportFixture()
- : transport(nullptr)
- , remoteSocket(g_io)
- , receivedPackets(nullptr)
- {
- }
-
void
initialize(ip::address address,
ndn::nfd::FacePersistency persistency = ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
@@ -66,7 +57,7 @@
transport = static_cast<UnicastUdpTransport*>(face->getTransport());
receivedPackets = &static_cast<DummyLinkService*>(face->getLinkService())->receivedPackets;
- BOOST_REQUIRE_EQUAL(transport->getState(), TransportState::UP);
+ BOOST_REQUIRE_EQUAL(transport->getState(), face::TransportState::UP);
}
void
@@ -106,17 +97,15 @@
protected:
LimitedIo limitedIo;
- UnicastUdpTransport* transport;
+ UnicastUdpTransport* transport = nullptr;
udp::endpoint localEp;
- udp::socket remoteSocket;
- std::vector<RxPacket>* receivedPackets;
+ udp::socket remoteSocket{g_io};
+ std::vector<RxPacket>* receivedPackets = nullptr;
private:
unique_ptr<Face> face;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_UNICAST_UDP_TRANSPORT_FIXTURE_HPP