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/common/config-file.t.cpp b/tests/daemon/common/config-file.t.cpp
index e1c7333..79c8e08 100644
--- a/tests/daemon/common/config-file.t.cpp
+++ b/tests/daemon/common/config-file.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -31,8 +31,7 @@
#include <fstream>
#include <sstream>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(TestConfigFile)
@@ -429,5 +428,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestConfigFile
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/common/counter.t.cpp b/tests/daemon/common/counter.t.cpp
index 60de483..5cffcdb 100644
--- a/tests/daemon/common/counter.t.cpp
+++ b/tests/daemon/common/counter.t.cpp
@@ -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,
@@ -27,8 +27,7 @@
#include "tests/test-common.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(TestCounter)
@@ -89,5 +88,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestCounter
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/common/global.t.cpp b/tests/daemon/common/global.t.cpp
index dced382..b738d32 100644
--- a/tests/daemon/common/global.t.cpp
+++ b/tests/daemon/common/global.t.cpp
@@ -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,
@@ -31,8 +31,7 @@
#include <thread>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_FIXTURE_TEST_SUITE(TestGlobal, GlobalIoFixture)
@@ -140,5 +139,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestGlobal
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/common/privilege-helper.t.cpp b/tests/daemon/common/privilege-helper.t.cpp
index c670a5f..d519805 100644
--- a/tests/daemon/common/privilege-helper.t.cpp
+++ b/tests/daemon/common/privilege-helper.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -27,8 +27,7 @@
#include "tests/test-common.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(TestPrivilegeHelper)
@@ -69,5 +68,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestPrivilegeHelper
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/channel-fixture.hpp b/tests/daemon/face/channel-fixture.hpp
index c3d07c6..f612f6d 100644
--- a/tests/daemon/face/channel-fixture.hpp
+++ b/tests/daemon/face/channel-fixture.hpp
@@ -34,16 +34,12 @@
#include <type_traits>
-namespace nfd {
-namespace face {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
template<class ChannelT, class EndpointT>
class ChannelFixture : public GlobalIoFixture
{
- static_assert(std::is_base_of_v<Channel, ChannelT>);
+ static_assert(std::is_base_of_v<face::Channel, ChannelT>);
public:
virtual
@@ -108,8 +104,6 @@
uint16_t m_nextPort = 7050;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_CHANNEL_FIXTURE_HPP
diff --git a/tests/daemon/face/datagram-transport.t.cpp b/tests/daemon/face/datagram-transport.t.cpp
index 631e394..055584c 100644
--- a/tests/daemon/face/datagram-transport.t.cpp
+++ b/tests/daemon/face/datagram-transport.t.cpp
@@ -30,9 +30,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_AUTO_TEST_SUITE(TestDatagramTransport)
@@ -174,6 +174,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestDatagramTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/dummy-face.cpp b/tests/daemon/face/dummy-face.cpp
index b7e74ca..246f9cc 100644
--- a/tests/daemon/face/dummy-face.cpp
+++ b/tests/daemon/face/dummy-face.cpp
@@ -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,
@@ -27,9 +27,7 @@
#include "dummy-link-service.hpp"
#include "dummy-transport.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
DummyFace::DummyFace(const std::string& localUri, const std::string& remoteUri,
ndn::nfd::FaceScope scope, ndn::nfd::FacePersistency persistency,
@@ -45,7 +43,7 @@
}
void
-DummyFace::setState(FaceState state)
+DummyFace::setState(face::FaceState state)
{
static_cast<DummyTransport*>(getTransport())->setState(state);
}
@@ -74,6 +72,4 @@
return static_cast<DummyLinkService*>(getLinkService());
}
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/dummy-face.hpp b/tests/daemon/face/dummy-face.hpp
index 94b5363..8374430 100644
--- a/tests/daemon/face/dummy-face.hpp
+++ b/tests/daemon/face/dummy-face.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,
@@ -28,9 +28,7 @@
#include "face/face.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
class DummyLinkService;
@@ -57,7 +55,7 @@
* \throw std::runtime_error state transition is invalid
*/
void
- setState(FaceState state);
+ setState(face::FaceState state);
/** \brief causes the face to receive an Interest
*/
@@ -92,13 +90,6 @@
std::vector<lp::Nack>& sentNacks;
};
-} // namespace tests
-} // namespace face
-
-namespace tests {
-using nfd::face::tests::DummyFace;
-} // namespace tests
-
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_DUMMY_FACE_HPP
diff --git a/tests/daemon/face/dummy-link-service.cpp b/tests/daemon/face/dummy-link-service.cpp
index 820d05b..5b33784 100644
--- a/tests/daemon/face/dummy-link-service.cpp
+++ b/tests/daemon/face/dummy-link-service.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, 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,
@@ -25,9 +25,7 @@
#include "dummy-link-service.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
void
DummyLinkService::doSendInterest(const Interest& interest)
@@ -63,6 +61,4 @@
receivedPackets.push_back({packet, endpoint});
}
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/dummy-link-service.hpp b/tests/daemon/face/dummy-link-service.hpp
index 3d77968..6661f0c 100644
--- a/tests/daemon/face/dummy-link-service.hpp
+++ b/tests/daemon/face/dummy-link-service.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, 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,
@@ -28,9 +28,7 @@
#include "face/link-service.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
enum PacketLoggingFlags : unsigned {
LogNothing = 0, ///< disable packet logging
@@ -50,7 +48,7 @@
/** \brief A dummy LinkService that logs all sent and received packets.
*/
-class DummyLinkService final : public LinkService
+class DummyLinkService final : public face::LinkService
{
public:
/** \brief Emitted after a network-layer packet is sent through this link service.
@@ -94,8 +92,6 @@
PacketLoggingFlags m_loggingFlags = LogAllPackets;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_DUMMY_LINK_SERVICE_HPP
diff --git a/tests/daemon/face/dummy-transport.hpp b/tests/daemon/face/dummy-transport.hpp
index 8ebb582..2eb21fe 100644
--- a/tests/daemon/face/dummy-transport.hpp
+++ b/tests/daemon/face/dummy-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, 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,
@@ -30,9 +30,7 @@
#include "face/null-transport.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
/** \brief Dummy Transport type used in unit tests.
*
@@ -41,7 +39,7 @@
* All persistency changes are recorded in `persistencyHistory`.
*/
template<bool CAN_CHANGE_PERSISTENCY>
-class DummyTransportBase : public NullTransport
+class DummyTransportBase : public face::NullTransport
{
public:
explicit
@@ -50,8 +48,8 @@
ndn::nfd::FaceScope scope = ndn::nfd::FACE_SCOPE_NON_LOCAL,
ndn::nfd::FacePersistency persistency = ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
ndn::nfd::LinkType linkType = ndn::nfd::LINK_TYPE_POINT_TO_POINT,
- ssize_t mtu = MTU_UNLIMITED,
- ssize_t sendQueueCapacity = QUEUE_UNSUPPORTED)
+ ssize_t mtu = face::MTU_UNLIMITED,
+ ssize_t sendQueueCapacity = face::QUEUE_UNSUPPORTED)
: NullTransport(FaceUri(localUri), FaceUri(remoteUri), scope, persistency)
{
this->setLinkType(linkType);
@@ -110,8 +108,6 @@
using DummyTransport = DummyTransportBase<true>;
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_DUMMY_TRANSPORT_HPP
diff --git a/tests/daemon/face/ethernet-channel.t.cpp b/tests/daemon/face/ethernet-channel.t.cpp
index 753f36a..95bf034 100644
--- a/tests/daemon/face/ethernet-channel.t.cpp
+++ b/tests/daemon/face/ethernet-channel.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, 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,
@@ -29,9 +29,9 @@
#include "tests/test-common.hpp"
#include "ethernet-fixture.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using face::EthernetChannel;
class EthernetChannelFixture : public EthernetFixture
{
@@ -99,6 +99,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestEthernetChannel
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/ethernet-factory.t.cpp b/tests/daemon/face/ethernet-factory.t.cpp
index 269c79f..b6d2516 100644
--- a/tests/daemon/face/ethernet-factory.t.cpp
+++ b/tests/daemon/face/ethernet-factory.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, 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,
@@ -31,9 +31,9 @@
#include <boost/algorithm/string/replace.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using face::EthernetFactory;
class EthernetFactoryFixture : public EthernetFixture
, public FaceSystemFactoryFixture<EthernetFactory>
@@ -548,6 +548,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestEthernetFactory
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/ethernet-fixture.hpp b/tests/daemon/face/ethernet-fixture.hpp
index 0c98c72..915b2c0 100644
--- a/tests/daemon/face/ethernet-fixture.hpp
+++ b/tests/daemon/face/ethernet-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, 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,
@@ -32,13 +32,14 @@
#include "tests/daemon/limited-io.hpp"
#include "test-netif.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using face::EthernetTransport;
+using face::MulticastEthernetTransport;
+using face::UnicastEthernetTransport;
-/** \brief Fixture providing a list of EthernetTransport-capable network interfaces.
+/**
+ * \brief Fixture providing a list of EthernetTransport-capable network interfaces.
*/
class EthernetFixture : public virtual GlobalIoFixture
{
@@ -48,8 +49,8 @@
for (const auto& netif : collectNetworkInterfaces()) {
if (!netif->isLoopback() && netif->isUp()) {
try {
- MulticastEthernetTransport transport(*netif, ethernet::getBroadcastAddress(),
- ndn::nfd::LINK_TYPE_MULTI_ACCESS);
+ MulticastEthernetTransport t(*netif, ethernet::getBroadcastAddress(),
+ ndn::nfd::LINK_TYPE_MULTI_ACCESS);
netifs.push_back(netif);
}
catch (const EthernetTransport::Error&) {
@@ -121,6 +122,8 @@
ethernet::Address remoteEp;
};
+} // namespace nfd::tests
+
#define SKIP_IF_ETHERNET_NETIF_COUNT_LT(n) \
do { \
if (this->netifs.size() < (n)) { \
@@ -139,8 +142,4 @@
} \
} while (false)
-} // namespace tests
-} // namespace face
-} // namespace nfd
-
#endif // NFD_TESTS_DAEMON_FACE_ETHERNET_FIXTURE_HPP
diff --git a/tests/daemon/face/face-system-fixture.hpp b/tests/daemon/face/face-system-fixture.hpp
index de3aca8..1891a97 100644
--- a/tests/daemon/face/face-system-fixture.hpp
+++ b/tests/daemon/face/face-system-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,
@@ -37,11 +37,7 @@
#include <ndn-cxx/net/network-monitor-stub.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
class FaceSystemFixture : public virtual GlobalIoFixture
{
@@ -140,10 +136,11 @@
FaceTable faceTable;
shared_ptr<ndn::net::NetworkMonitorStub> netmon;
FaceSystem faceSystem;
- NetdevBound& netdevBound;
+ face::NetdevBound& netdevBound;
};
-/** \brief FaceSystemFixture with a ProtocolFactory reference
+/**
+ * \brief FaceSystemFixture with a ProtocolFactory reference
*/
template<typename FactoryType>
class FaceSystemFactoryFixture : public FaceSystemFixture
@@ -158,9 +155,10 @@
FactoryType& factory;
};
-/** \brief A dummy ProtocolFactory for testing FaceSystem configuration parsing.
+/**
+ * \brief A dummy ProtocolFactory for testing FaceSystem configuration parsing.
*/
-class DummyProtocolFactory : public ProtocolFactory
+class DummyProtocolFactory : public face::ProtocolFactory
{
public:
using ProtocolFactory::ProtocolFactory;
@@ -188,8 +186,6 @@
std::set<std::string> newProvidedSchemes;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_FACE_SYSTEM_FIXTURE_HPP
diff --git a/tests/daemon/face/face-system.t.cpp b/tests/daemon/face/face-system.t.cpp
index a7be4c8..336aa11 100644
--- a/tests/daemon/face/face-system.t.cpp
+++ b/tests/daemon/face/face-system.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, 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,
@@ -28,9 +28,9 @@
#include "tests/test-common.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestFaceSystem, FaceSystemFixture)
@@ -164,6 +164,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFaceSystem
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/face.t.cpp b/tests/daemon/face/face.t.cpp
index bcaa90a..34a19a7 100644
--- a/tests/daemon/face/face.t.cpp
+++ b/tests/daemon/face/face.t.cpp
@@ -31,11 +31,9 @@
#include "dummy-face.hpp"
#include "dummy-transport.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestFace, GlobalIoFixture)
@@ -149,6 +147,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFace
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/factory-test-common.hpp b/tests/daemon/face/factory-test-common.hpp
index 4e65d34..1c7252e 100644
--- a/tests/daemon/face/factory-test-common.hpp
+++ b/tests/daemon/face/factory-test-common.hpp
@@ -30,9 +30,7 @@
#include "tests/test-common.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
struct CreateFaceExpectedResult
{
@@ -42,46 +40,44 @@
};
inline void
-createFace(ProtocolFactory& factory,
+createFace(face::ProtocolFactory& factory,
const FaceUri& remoteUri,
const std::optional<FaceUri>& localUri,
- const FaceParams& params,
+ const face::FaceParams& params,
const CreateFaceExpectedResult& expected,
const std::function<void(const Face&)>& extraChecks = nullptr)
{
factory.createFace({remoteUri, localUri, params},
- [expected, extraChecks] (const shared_ptr<Face>& face) {
- BOOST_CHECK_EQUAL(CreateFaceExpectedResult::SUCCESS, expected.result);
+ [result = expected.result, extraChecks] (const auto& face) {
+ BOOST_CHECK_EQUAL(CreateFaceExpectedResult::SUCCESS, result);
if (extraChecks) {
extraChecks(*face);
}
},
- [expected] (uint32_t actualStatus, const std::string& actualReason) {
+ [expected] (uint32_t actualStatus, const auto& actualReason) {
BOOST_CHECK_EQUAL(CreateFaceExpectedResult::FAILURE, expected.result);
BOOST_CHECK_EQUAL(actualStatus, expected.status);
BOOST_CHECK_EQUAL(actualReason, expected.reason);
});
}
-/** \brief check that channels in a factory equal given channel URIs
+/**
+ * \brief Check that channels in a factory equal given channel URIs
*/
inline void
-checkChannelListEqual(const ProtocolFactory& factory, const std::set<std::string>& channelUris)
+checkChannelListEqual(const face::ProtocolFactory& factory, std::set<std::string> expectedUris)
{
- std::set<std::string> expected(channelUris); // make a copy so we can erase as we go
for (const auto& channel : factory.getChannels()) {
- std::string uri = channel->getUri().toString();
- if (expected.erase(uri) == 0) {
+ auto uri = channel->getUri().toString();
+ if (expectedUris.erase(uri) == 0) {
BOOST_ERROR("Unexpected channel " << uri);
}
}
- for (const auto& uri : expected) {
+ for (const auto& uri : expectedUris) {
BOOST_ERROR("Missing channel " << uri);
}
}
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_FACTORY_TEST_COMMON_HPP
diff --git a/tests/daemon/face/generic-link-service.t.cpp b/tests/daemon/face/generic-link-service.t.cpp
index e4f0425..06d9417 100644
--- a/tests/daemon/face/generic-link-service.t.cpp
+++ b/tests/daemon/face/generic-link-service.t.cpp
@@ -35,11 +35,9 @@
#include <ndn-cxx/lp/prefix-announcement-header.hpp>
#include <ndn-cxx/lp/tags.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
@@ -1470,6 +1468,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestGenericLinkService
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/internal-face.t.cpp b/tests/daemon/face/internal-face.t.cpp
index 1f2b82a..5c57341 100644
--- a/tests/daemon/face/internal-face.t.cpp
+++ b/tests/daemon/face/internal-face.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -29,11 +29,9 @@
#include "tests/key-chain-fixture.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
@@ -218,6 +216,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestInternalFace
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/lp-fragmenter.t.cpp b/tests/daemon/face/lp-fragmenter.t.cpp
index 8bd48c2..065fc6d 100644
--- a/tests/daemon/face/lp-fragmenter.t.cpp
+++ b/tests/daemon/face/lp-fragmenter.t.cpp
@@ -27,11 +27,9 @@
#include "tests/test-common.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::face;
class LpFragmenterFixture
{
@@ -174,6 +172,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestLpFragmentation
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/lp-reassembler.t.cpp b/tests/daemon/face/lp-reassembler.t.cpp
index 8e8bbce..16a3592 100644
--- a/tests/daemon/face/lp-reassembler.t.cpp
+++ b/tests/daemon/face/lp-reassembler.t.cpp
@@ -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,
@@ -28,11 +28,9 @@
#include "tests/test-common.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::face;
class LpReassemblerFixture : public GlobalIoTimeFixture
{
@@ -41,7 +39,7 @@
{
reassembler.beforeTimeout.connect(
[this] (EndpointId remoteEp, size_t nDroppedFragments) {
- timeoutHistory.push_back({remoteEp, nDroppedFragments});
+ timeoutHistory.emplace_back(remoteEp, nDroppedFragments);
});
}
@@ -49,12 +47,10 @@
LpReassembler reassembler{{}};
std::vector<std::pair<EndpointId, size_t>> timeoutHistory;
- static const uint8_t data[10];
-};
-
-const uint8_t LpReassemblerFixture::data[10] = {
- 0x06, 0x08, // Data
- 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+ static constexpr uint8_t data[] = {
+ 0x06, 0x08, // Data
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+ };
};
BOOST_AUTO_TEST_SUITE(Face)
@@ -517,6 +513,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestLpReassembler
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/lp-reliability.t.cpp b/tests/daemon/face/lp-reliability.t.cpp
index 0d891e0..81c28e0 100644
--- a/tests/daemon/face/lp-reliability.t.cpp
+++ b/tests/daemon/face/lp-reliability.t.cpp
@@ -35,11 +35,9 @@
#include <cstring>
#include <unordered_set>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::face;
class DummyLpReliabilityLinkService : public GenericLinkService
{
@@ -1043,6 +1041,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestLpReliability
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/multicast-ethernet-transport.t.cpp b/tests/daemon/face/multicast-ethernet-transport.t.cpp
index 84dead4..bff61c7 100644
--- a/tests/daemon/face/multicast-ethernet-transport.t.cpp
+++ b/tests/daemon/face/multicast-ethernet-transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, 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,
@@ -29,9 +29,9 @@
#include "common/global.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestMulticastEthernetTransport, EthernetFixture)
@@ -140,6 +140,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestMulticastEthernetTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/multicast-udp-transport-fixture.hpp b/tests/daemon/face/multicast-udp-transport-fixture.hpp
index 99d039c..959ca9c 100644
--- a/tests/daemon/face/multicast-udp-transport-fixture.hpp
+++ b/tests/daemon/face/multicast-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,26 +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::MulticastUdpTransport;
class MulticastUdpTransportFixture : public GlobalIoFixture
{
protected:
- MulticastUdpTransportFixture()
- : transport(nullptr)
- , txPort(7001)
- , receivedPackets(nullptr)
- , remoteSockRx(g_io)
- , remoteSockTx(g_io)
- {
- }
-
void
initialize(ip::address address)
{
@@ -84,7 +73,7 @@
transport = static_cast<MulticastUdpTransport*>(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
@@ -120,20 +109,18 @@
protected:
LimitedIo limitedIo;
- MulticastUdpTransport* transport;
+ MulticastUdpTransport* transport = nullptr;
udp::endpoint mcastEp;
- uint16_t txPort;
- std::vector<RxPacket>* receivedPackets;
+ uint16_t txPort = 7001;
+ std::vector<RxPacket>* receivedPackets = nullptr;
private:
unique_ptr<Face> face;
udp::endpoint remoteMcastEp;
- udp::socket remoteSockRx;
- udp::socket remoteSockTx;
+ udp::socket remoteSockRx{g_io};
+ udp::socket remoteSockTx{g_io};
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_MULTICAST_UDP_TRANSPORT_FIXTURE_HPP
diff --git a/tests/daemon/face/multicast-udp-transport.t.cpp b/tests/daemon/face/multicast-udp-transport.t.cpp
index 636bdc5..f32d30f 100644
--- a/tests/daemon/face/multicast-udp-transport.t.cpp
+++ b/tests/daemon/face/multicast-udp-transport.t.cpp
@@ -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,
@@ -29,9 +29,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
@@ -114,6 +114,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestMulticastUdpTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/netdev-bound.t.cpp b/tests/daemon/face/netdev-bound.t.cpp
index 9f71fc1..ede55c3 100644
--- a/tests/daemon/face/netdev-bound.t.cpp
+++ b/tests/daemon/face/netdev-bound.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, 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,
@@ -28,9 +28,9 @@
#include "tests/test-common.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestNetdevBound, FaceSystemFixture)
@@ -111,6 +111,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestNetdevBound
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/network-predicate.t.cpp b/tests/daemon/face/network-predicate.t.cpp
index 73e29c6..05094fc 100644
--- a/tests/daemon/face/network-predicate.t.cpp
+++ b/tests/daemon/face/network-predicate.t.cpp
@@ -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,
@@ -34,9 +34,7 @@
#include <boost/property_tree/info_parser.hpp>
#include <sstream>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Face)
BOOST_AUTO_TEST_SUITE(TestNetworkPredicate)
@@ -66,7 +64,7 @@
T predicate;
};
-class NetworkInterfacePredicateFixture : public NetworkPredicateBaseFixture<NetworkInterfacePredicate>
+class NetworkInterfacePredicateFixture : public NetworkPredicateBaseFixture<face::NetworkInterfacePredicate>
{
protected:
NetworkInterfacePredicateFixture()
@@ -377,7 +375,7 @@
BOOST_AUTO_TEST_SUITE_END() // NetworkInterface
-class IpAddressPredicateFixture : public NetworkPredicateBaseFixture<IpAddressPredicate>
+class IpAddressPredicateFixture : public NetworkPredicateBaseFixture<face::IpAddressPredicate>
{
protected:
IpAddressPredicateFixture()
@@ -512,6 +510,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestNetworkPredicate
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/null-face.t.cpp b/tests/daemon/face/null-face.t.cpp
index 4a5f539..ad5e4cf 100644
--- a/tests/daemon/face/null-face.t.cpp
+++ b/tests/daemon/face/null-face.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, 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,
@@ -29,11 +29,9 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "transport-test-common.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestNullFace, GlobalIoFixture)
@@ -102,6 +100,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestNullFace
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/stream-transport.t.cpp b/tests/daemon/face/stream-transport.t.cpp
index c8fa82b..80524b5 100644
--- a/tests/daemon/face/stream-transport.t.cpp
+++ b/tests/daemon/face/stream-transport.t.cpp
@@ -30,9 +30,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_AUTO_TEST_SUITE(TestStreamTransport)
@@ -236,6 +236,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStreamTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/tcp-channel-fixture.hpp b/tests/daemon/face/tcp-channel-fixture.hpp
index ab8d431..b6eb99c 100644
--- a/tests/daemon/face/tcp-channel-fixture.hpp
+++ b/tests/daemon/face/tcp-channel-fixture.hpp
@@ -31,9 +31,9 @@
#include "channel-fixture.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using face::TcpChannel;
class TcpChannelFixture : public ChannelFixture<TcpChannel, tcp::Endpoint>
{
@@ -83,11 +83,9 @@
protected:
std::vector<shared_ptr<Face>> clientFaces;
- IpAddressPredicate local;
+ face::IpAddressPredicate local;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_TCP_CHANNEL_FIXTURE_HPP
diff --git a/tests/daemon/face/tcp-channel.t.cpp b/tests/daemon/face/tcp-channel.t.cpp
index 6789966..9f838c4 100644
--- a/tests/daemon/face/tcp-channel.t.cpp
+++ b/tests/daemon/face/tcp-channel.t.cpp
@@ -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,
@@ -26,11 +26,10 @@
#include "tcp-channel-fixture.hpp"
#include "test-ip.hpp"
+
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestTcpChannel, TcpChannelFixture)
@@ -64,6 +63,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestTcpChannel
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/tcp-factory.t.cpp b/tests/daemon/face/tcp-factory.t.cpp
index a6335f9..2547e30 100644
--- a/tests/daemon/face/tcp-factory.t.cpp
+++ b/tests/daemon/face/tcp-factory.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -29,9 +29,10 @@
#include "factory-test-common.hpp"
#include "tests/daemon/limited-io.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using face::TcpChannel;
+using face::TcpFactory;
class TcpFactoryFixture : public FaceSystemFactoryFixture<TcpFactory>
{
@@ -175,7 +176,7 @@
BOOST_CHECK_EQUAL(face.getScope(), ndn::nfd::FACE_SCOPE_LOCAL);
});
- limitedIo.run(1, 100_ms);
+ limitedIo.defer(100_ms);
}
BOOST_AUTO_TEST_CASE(ConfigureNonLocal)
@@ -217,7 +218,7 @@
BOOST_CHECK_EQUAL(face.getScope(), ndn::nfd::FACE_SCOPE_NON_LOCAL);
});
- limitedIo.run(1, 100_ms);
+ limitedIo.defer(100_ms);
}
BOOST_AUTO_TEST_CASE(Omitted)
@@ -468,6 +469,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestTcpFactory
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/tcp-transport-fixture.hpp b/tests/daemon/face/tcp-transport-fixture.hpp
index 4b382a8..2ea4a2b 100644
--- a/tests/daemon/face/tcp-transport-fixture.hpp
+++ b/tests/daemon/face/tcp-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,25 +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::tcp;
+using face::TcpTransport;
class TcpTransportFixture : public GlobalIoFixture
{
protected:
- TcpTransportFixture()
- : transport(nullptr)
- , remoteSocket(g_io)
- , receivedPackets(nullptr)
- , acceptor(g_io)
- {
- }
-
void
startAccept(const tcp::endpoint& remoteEp)
{
@@ -103,7 +93,7 @@
transport = static_cast<TcpTransport*>(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
@@ -120,18 +110,16 @@
protected:
LimitedIo limitedIo;
- TcpTransport* transport;
+ TcpTransport* transport = nullptr;
tcp::endpoint localEp;
- tcp::socket remoteSocket;
- std::vector<RxPacket>* receivedPackets;
+ tcp::socket remoteSocket{g_io};
+ std::vector<RxPacket>* receivedPackets = nullptr;
private:
- tcp::acceptor acceptor;
+ tcp::acceptor acceptor{g_io};
unique_ptr<Face> face;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_TCP_TRANSPORT_FIXTURE_HPP
diff --git a/tests/daemon/face/tcp-transport.t.cpp b/tests/daemon/face/tcp-transport.t.cpp
index c01aaef..3d86064 100644
--- a/tests/daemon/face/tcp-transport.t.cpp
+++ b/tests/daemon/face/tcp-transport.t.cpp
@@ -29,9 +29,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestTcpTransport, IpTransportFixture<TcpTransportFixture>)
@@ -234,6 +234,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestTcpTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/tcp-udp-channel.t.cpp b/tests/daemon/face/tcp-udp-channel.t.cpp
index 020c954..6a29660 100644
--- a/tests/daemon/face/tcp-udp-channel.t.cpp
+++ b/tests/daemon/face/tcp-udp-channel.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, 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,
@@ -27,11 +27,10 @@
#include "udp-channel-fixture.hpp"
#include "test-ip.hpp"
+
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Face)
BOOST_AUTO_TEST_SUITE(TestTcpUdpChannel)
@@ -150,6 +149,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestTcpUdpChannel
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/test-ip.cpp b/tests/daemon/face/test-ip.cpp
index 3e75d8c..593797e 100644
--- a/tests/daemon/face/test-ip.cpp
+++ b/tests/daemon/face/test-ip.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, 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,
@@ -26,9 +26,7 @@
#include "test-ip.hpp"
#include "test-netif.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
std::ostream&
operator<<(std::ostream& os, AddressFamily family)
@@ -106,6 +104,4 @@
return {};
}
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/test-ip.hpp b/tests/daemon/face/test-ip.hpp
index 1b8604e..c2bb8ca 100644
--- a/tests/daemon/face/test-ip.hpp
+++ b/tests/daemon/face/test-ip.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, 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,
@@ -31,9 +31,7 @@
#include <boost/asio/ip/address.hpp>
#include <ndn-cxx/net/network-address.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
enum class AddressFamily {
V4 = static_cast<int>(ndn::net::AddressFamily::V4),
@@ -92,9 +90,11 @@
AddressScope scope = AddressScope::Any,
MulticastInterface mcast = MulticastInterface::Any);
+} // namespace nfd::tests
+
/** \brief Skip the rest of the test case if \p address is unavailable
*
- * This macro can be used in conjunction with 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)
* {
@@ -112,8 +112,4 @@
} \
} while (false)
-} // namespace tests
-} // namespace face
-} // namespace nfd
-
#endif // NFD_TESTS_DAEMON_FACE_TEST_IP_HPP
diff --git a/tests/daemon/face/test-netif.cpp b/tests/daemon/face/test-netif.cpp
index 36719ad..1a2752b 100644
--- a/tests/daemon/face/test-netif.cpp
+++ b/tests/daemon/face/test-netif.cpp
@@ -26,9 +26,7 @@
#include "test-netif.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
std::vector<shared_ptr<const NetworkInterface>>
enumerateNetworkInterfaces(NetworkMonitor& netmon)
@@ -52,6 +50,4 @@
return *cached;
}
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/test-netif.hpp b/tests/daemon/face/test-netif.hpp
index 42820dd..a1e354e 100644
--- a/tests/daemon/face/test-netif.hpp
+++ b/tests/daemon/face/test-netif.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,
@@ -32,9 +32,7 @@
#include <ndn-cxx/net/network-interface.hpp>
#include <ndn-cxx/net/network-monitor.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
using ndn::net::NetworkAddress;
using ndn::net::NetworkInterface;
@@ -56,8 +54,6 @@
std::vector<shared_ptr<const NetworkInterface>>
collectNetworkInterfaces(bool allowCached = true);
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_TEST_NETIF_HPP
diff --git a/tests/daemon/face/transport-test-common.hpp b/tests/daemon/face/transport-test-common.hpp
index fa3e4bd..34133a1 100644
--- a/tests/daemon/face/transport-test-common.hpp
+++ b/tests/daemon/face/transport-test-common.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, 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,
@@ -30,9 +30,7 @@
#include "tests/test-common.hpp"
#include "test-ip.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
/** \brief Check that a transport has all its static properties set after initialization
*
@@ -42,14 +40,14 @@
* Thus, if a transport forgets to set a static property, this check would fail.
*/
inline void
-checkStaticPropertiesInitialized(const Transport& transport)
+checkStaticPropertiesInitialized(const face::Transport& transport)
{
BOOST_CHECK(!transport.getLocalUri().getScheme().empty());
BOOST_CHECK(!transport.getRemoteUri().getScheme().empty());
BOOST_CHECK_NE(transport.getScope(), ndn::nfd::FACE_SCOPE_NONE);
BOOST_CHECK_NE(transport.getPersistency(), ndn::nfd::FACE_PERSISTENCY_NONE);
BOOST_CHECK_NE(transport.getLinkType(), ndn::nfd::LINK_TYPE_NONE);
- BOOST_CHECK_NE(transport.getMtu(), MTU_INVALID);
+ BOOST_CHECK_NE(transport.getMtu(), face::MTU_INVALID);
}
/** \brief Generic wrapper for transport fixtures that require an IP address
@@ -69,7 +67,7 @@
" TestIp=" << address);
}
- std::pair<bool, std::string>
+ [[nodiscard]] std::pair<bool, std::string>
checkPreconditions() const
{
return {!address.is_unspecified(), "no appropriate IP address available"};
@@ -88,9 +86,7 @@
const boost::asio::ip::address address = getTestIp(AF, AS, MC);
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#define GENERATE_IP_TRANSPORT_FIXTURE_INSTANTIATIONS(F) \
IpTransportFixture<F, AddressFamily::V4, AddressScope::Loopback>, \
@@ -101,9 +97,9 @@
#define TRANSPORT_TEST_CHECK_PRECONDITIONS() \
do { \
- auto result = this->checkPreconditions(); \
- if (!result.first) { \
- BOOST_WARN_MESSAGE(false, "skipping test case: " << result.second); \
+ auto [ok, reason] = this->checkPreconditions(); \
+ if (!ok) { \
+ BOOST_WARN_MESSAGE(false, "skipping test case: " << reason); \
return; \
} \
} while (false)
diff --git a/tests/daemon/face/transport.t.cpp b/tests/daemon/face/transport.t.cpp
index 7e650dd..9545b83 100644
--- a/tests/daemon/face/transport.t.cpp
+++ b/tests/daemon/face/transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, 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,
@@ -40,12 +40,10 @@
#include <boost/mpl/set.hpp>
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
namespace mpl = boost::mpl;
-using namespace nfd::tests;
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_AUTO_TEST_SUITE(TestTransport)
@@ -145,8 +143,8 @@
{
auto transport = make_unique<DummyTransport>();
- TransportState from = static_cast<TransportState>(T::first::value);
- TransportState to = static_cast<TransportState>(T::second::value);
+ auto from = static_cast<TransportState>(T::first::value);
+ auto to = static_cast<TransportState>(T::second::value);
BOOST_TEST_MESSAGE("SetState " << from << " -> " << to);
// enter from state
@@ -248,6 +246,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/udp-channel-fixture.hpp b/tests/daemon/face/udp-channel-fixture.hpp
index ac30738..a314a8c 100644
--- a/tests/daemon/face/udp-channel-fixture.hpp
+++ b/tests/daemon/face/udp-channel-fixture.hpp
@@ -31,9 +31,9 @@
#include "channel-fixture.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using face::UdpChannel;
class UdpChannelFixture : public ChannelFixture<UdpChannel, udp::Endpoint>
{
@@ -69,8 +69,6 @@
std::vector<shared_ptr<Face>> clientFaces;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_UDP_CHANNEL_FIXTURE_HPP
diff --git a/tests/daemon/face/udp-channel.t.cpp b/tests/daemon/face/udp-channel.t.cpp
index b61e5af..d36e2f5 100644
--- a/tests/daemon/face/udp-channel.t.cpp
+++ b/tests/daemon/face/udp-channel.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -26,11 +26,10 @@
#include "udp-channel-fixture.hpp"
#include "test-ip.hpp"
+
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestUdpChannel, UdpChannelFixture)
@@ -64,6 +63,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestUdpChannel
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/udp-factory.t.cpp b/tests/daemon/face/udp-factory.t.cpp
index e2788f5..c243ddc 100644
--- a/tests/daemon/face/udp-factory.t.cpp
+++ b/tests/daemon/face/udp-factory.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -30,9 +30,10 @@
#include <boost/algorithm/string/replace.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using face::UdpChannel;
+using face::UdpFactory;
class UdpFactoryFixture : public FaceSystemFactoryFixture<UdpFactory>
{
@@ -1114,6 +1115,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestUdpFactory
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/unicast-ethernet-transport.t.cpp b/tests/daemon/face/unicast-ethernet-transport.t.cpp
index 79a0f38..54c262d 100644
--- a/tests/daemon/face/unicast-ethernet-transport.t.cpp
+++ b/tests/daemon/face/unicast-ethernet-transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, 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,
@@ -29,9 +29,9 @@
#include "common/global.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestUnicastEthernetTransport, EthernetFixture)
@@ -180,6 +180,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestUnicastEthernetTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
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
diff --git a/tests/daemon/face/unicast-udp-transport.t.cpp b/tests/daemon/face/unicast-udp-transport.t.cpp
index 24d47fd..bb5605e 100644
--- a/tests/daemon/face/unicast-udp-transport.t.cpp
+++ b/tests/daemon/face/unicast-udp-transport.t.cpp
@@ -30,9 +30,9 @@
#include <boost/mpl/vector.hpp>
#include <boost/mpl/vector_c.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestUnicastUdpTransport, IpTransportFixture<UnicastUdpTransportFixture>)
@@ -177,6 +177,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestUnicastUdpTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/unix-stream-channel.t.cpp b/tests/daemon/face/unix-stream-channel.t.cpp
index fa9e480..e4ce0cf 100644
--- a/tests/daemon/face/unix-stream-channel.t.cpp
+++ b/tests/daemon/face/unix-stream-channel.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, 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,
@@ -30,12 +30,11 @@
#include <boost/filesystem.hpp>
#include <fstream>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
namespace fs = boost::filesystem;
namespace local = boost::asio::local;
+using face::UnixStreamChannel;
class UnixStreamChannelFixture : public ChannelFixture<UnixStreamChannel, unix_stream::Endpoint>
{
@@ -176,6 +175,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestUnixStreamChannel
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/unix-stream-factory.t.cpp b/tests/daemon/face/unix-stream-factory.t.cpp
index dd6f5cf..2554b25 100644
--- a/tests/daemon/face/unix-stream-factory.t.cpp
+++ b/tests/daemon/face/unix-stream-factory.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, 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,
@@ -28,17 +28,17 @@
#include "face-system-fixture.hpp"
#include "factory-test-common.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using face::UnixStreamFactory;
using UnixStreamFactoryFixture = FaceSystemFactoryFixture<UnixStreamFactory>;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestUnixStreamFactory, UnixStreamFactoryFixture)
-static const std::string CHANNEL_PATH1("unix-stream-test.1.sock");
-static const std::string CHANNEL_PATH2("unix-stream-test.2.sock");
+const std::string CHANNEL_PATH1("unix-stream-test.1.sock");
+const std::string CHANNEL_PATH2("unix-stream-test.2.sock");
BOOST_AUTO_TEST_SUITE(ProcessConfig)
@@ -145,6 +145,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestUnixStreamFactory
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/unix-stream-transport-fixture.hpp b/tests/daemon/face/unix-stream-transport-fixture.hpp
index 6724085..9603247 100644
--- a/tests/daemon/face/unix-stream-transport-fixture.hpp
+++ b/tests/daemon/face/unix-stream-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,
@@ -35,14 +35,13 @@
#include <boost/filesystem.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
-typedef boost::asio::local::stream_protocol unix_stream;
+using unix_stream = boost::asio::local::stream_protocol;
+using face::UnixStreamTransport;
-/** \brief automatically unlinks the socket file of a Unix stream acceptor
+/**
+ * \brief Automatically unlinks the socket file of a Unix stream acceptor
*/
class AcceptorWithCleanup : public unix_stream::acceptor
{
@@ -117,7 +116,7 @@
transport = static_cast<UnixStreamTransport*>(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
@@ -144,8 +143,6 @@
unique_ptr<Face> face;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_UNIX_STREAM_TRANSPORT_FIXTURE_HPP
diff --git a/tests/daemon/face/unix-stream-transport.t.cpp b/tests/daemon/face/unix-stream-transport.t.cpp
index 8eebb60..41acb0b 100644
--- a/tests/daemon/face/unix-stream-transport.t.cpp
+++ b/tests/daemon/face/unix-stream-transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, 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,
@@ -27,9 +27,9 @@
#include "unix-stream-transport-fixture.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestUnixStreamTransport, UnixStreamTransportFixture)
@@ -63,6 +63,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestUnixStreamTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/websocket-channel-fixture.hpp b/tests/daemon/face/websocket-channel-fixture.hpp
index 62c717b..dc9a232 100644
--- a/tests/daemon/face/websocket-channel-fixture.hpp
+++ b/tests/daemon/face/websocket-channel-fixture.hpp
@@ -30,9 +30,9 @@
#include "channel-fixture.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using face::WebSocketChannel;
class WebSocketChannelFixture : public ChannelFixture<WebSocketChannel, websocket::Endpoint>
{
@@ -153,8 +153,6 @@
time::steady_clock::time_point m_prevPingRecvTime;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_WEBSOCKET_CHANNEL_FIXTURE_HPP
diff --git a/tests/daemon/face/websocket-channel.t.cpp b/tests/daemon/face/websocket-channel.t.cpp
index 5772daa..a396530 100644
--- a/tests/daemon/face/websocket-channel.t.cpp
+++ b/tests/daemon/face/websocket-channel.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -30,9 +30,7 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestWebSocketChannel, WebSocketChannelFixture)
@@ -199,9 +197,9 @@
2_s), LimitedIo::EXCEED_OPS);
BOOST_CHECK_EQUAL(listenerChannel->size(), 0);
- auto transport = static_cast<WebSocketTransport*>(listenerFaces.at(0)->getTransport());
- BOOST_CHECK(transport->getState() == TransportState::FAILED ||
- transport->getState() == TransportState::CLOSED);
+ auto transport = static_cast<face::WebSocketTransport*>(listenerFaces.at(0)->getTransport());
+ BOOST_CHECK(transport->getState() == face::TransportState::FAILED ||
+ transport->getState() == face::TransportState::CLOSED);
BOOST_CHECK_GE(transport->getCounters().nOutPings, 1);
BOOST_CHECK_LE(transport->getCounters().nOutPings, 2);
BOOST_CHECK_EQUAL(transport->getCounters().nInPongs, 0);
@@ -210,6 +208,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestWebSocketChannel
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/websocket-factory.t.cpp b/tests/daemon/face/websocket-factory.t.cpp
index b684cee..5043d87 100644
--- a/tests/daemon/face/websocket-factory.t.cpp
+++ b/tests/daemon/face/websocket-factory.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, 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,
@@ -28,9 +28,10 @@
#include "face-system-fixture.hpp"
#include "factory-test-common.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using face::WebSocketChannel;
+using face::WebSocketFactory;
class WebSocketFactoryFixture : public FaceSystemFactoryFixture<WebSocketFactory>
{
@@ -316,6 +317,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestWebSocketFactory
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/websocket-transport-fixture.hpp b/tests/daemon/face/websocket-transport-fixture.hpp
index b1700ed..2e1e61e 100644
--- a/tests/daemon/face/websocket-transport-fixture.hpp
+++ b/tests/daemon/face/websocket-transport-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,25 +33,16 @@
#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 face::WebSocketTransport;
/** \brief a fixture that accepts a single WebSocket connection from a client
*/
class WebSocketTransportFixture : public GlobalIoFixture
{
protected:
- WebSocketTransportFixture()
- : transport(nullptr)
- , serverReceivedPackets(nullptr)
- , clientShouldPong(true)
- {
- }
-
/** \brief initialize server and start listening
*/
void
@@ -114,7 +105,7 @@
transport = static_cast<WebSocketTransport*>(face->getTransport());
serverReceivedPackets = &static_cast<DummyLinkService*>(face->getLinkService())->receivedPackets;
- BOOST_REQUIRE_EQUAL(transport->getState(), TransportState::UP);
+ BOOST_REQUIRE_EQUAL(transport->getState(), face::TransportState::UP);
}
private:
@@ -202,20 +193,18 @@
websocket::Server server;
websocketpp::connection_hdl serverHdl;
ip::tcp::endpoint remoteEp;
- WebSocketTransport* transport;
- std::vector<RxPacket>* serverReceivedPackets;
+ WebSocketTransport* transport = nullptr;
+ std::vector<RxPacket>* serverReceivedPackets = nullptr;
websocket::Client client;
websocketpp::connection_hdl clientHdl;
- bool clientShouldPong;
+ bool clientShouldPong = true;
std::vector<std::string> clientReceivedMessages;
private:
unique_ptr<Face> face;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_WEBSOCKET_TRANSPORT_FIXTURE_HPP
diff --git a/tests/daemon/face/websocket-transport.t.cpp b/tests/daemon/face/websocket-transport.t.cpp
index 008a41f..fe79de9 100644
--- a/tests/daemon/face/websocket-transport.t.cpp
+++ b/tests/daemon/face/websocket-transport.t.cpp
@@ -29,9 +29,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestWebSocketTransport, IpTransportFixture<WebSocketTransportFixture>)
@@ -260,6 +260,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestWebSocketTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/access-strategy.t.cpp b/tests/daemon/fw/access-strategy.t.cpp
index cb55cca..6664a16 100644
--- a/tests/daemon/fw/access-strategy.t.cpp
+++ b/tests/daemon/fw/access-strategy.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -28,12 +28,10 @@
#include "strategy-tester.hpp"
#include "topology-tester.hpp"
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
// The tester is unused in this file, but it's used in various templated test suites.
-using AccessStrategyTester = StrategyTester<AccessStrategy>;
+using AccessStrategyTester = StrategyTester<fw::AccessStrategy>;
NFD_REGISTER_STRATEGY(AccessStrategyTester);
// This test suite tests AccessStrategy's behavior as a black box,
@@ -371,6 +369,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestAccessStrategy
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/algorithm.t.cpp b/tests/daemon/fw/algorithm.t.cpp
index d0bd2f0..ab00f2b 100644
--- a/tests/daemon/fw/algorithm.t.cpp
+++ b/tests/daemon/fw/algorithm.t.cpp
@@ -29,11 +29,9 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/face/dummy-face.hpp"
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::fw;
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_FIXTURE_TEST_SUITE(TestAlgorithm, GlobalIoFixture)
@@ -205,6 +203,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestPitAlgorithm
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/asf-measurements.t.cpp b/tests/daemon/fw/asf-measurements.t.cpp
index 92f1884..4de0493 100644
--- a/tests/daemon/fw/asf-measurements.t.cpp
+++ b/tests/daemon/fw/asf-measurements.t.cpp
@@ -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,
@@ -29,19 +29,14 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/face/dummy-face.hpp"
-namespace nfd {
-namespace fw {
-namespace asf {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_AUTO_TEST_SUITE(TestAsfMeasurements)
BOOST_FIXTURE_TEST_CASE(FaceInfo, GlobalIoTimeFixture)
{
- using asf::FaceInfo;
+ using fw::asf::FaceInfo;
FaceInfo info(nullptr);
BOOST_CHECK_EQUAL(info.getLastRtt(), FaceInfo::RTT_NO_MEASUREMENT);
@@ -79,7 +74,7 @@
BOOST_FIXTURE_TEST_CASE(NamespaceInfo, GlobalIoTimeFixture)
{
- using asf::NamespaceInfo;
+ using fw::asf::NamespaceInfo;
NamespaceInfo info(nullptr);
BOOST_CHECK(info.getFaceInfo(1234) == nullptr);
@@ -87,14 +82,11 @@
auto& faceInfo = info.getOrCreateFaceInfo(1234);
BOOST_CHECK(info.getFaceInfo(1234) == &faceInfo);
- this->advanceClocks(AsfMeasurements::MEASUREMENTS_LIFETIME + 1_s);
+ this->advanceClocks(fw::asf::AsfMeasurements::MEASUREMENTS_LIFETIME + 1_s);
BOOST_CHECK(info.getFaceInfo(1234) == nullptr); // expired
}
BOOST_AUTO_TEST_SUITE_END() // TestAsfStrategy
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace asf
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/asf-strategy.t.cpp b/tests/daemon/fw/asf-strategy.t.cpp
index e80a287..a853c79 100644
--- a/tests/daemon/fw/asf-strategy.t.cpp
+++ b/tests/daemon/fw/asf-strategy.t.cpp
@@ -28,12 +28,9 @@
#include "strategy-tester.hpp"
#include "topology-tester.hpp"
-namespace nfd {
-namespace fw {
-namespace asf {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::fw::tests;
+using fw::AsfStrategy;
// The tester is unused in this file, but it's used in various templated test suites.
using AsfStrategyTester = StrategyTester<AsfStrategy>;
@@ -574,9 +571,9 @@
strategy = checkValidity("/max-timeouts~0", true);
BOOST_TEST(strategy->m_probing.getProbingInterval() == 60_s);
BOOST_TEST(strategy->m_nMaxTimeouts == 0);
- BOOST_TEST(strategy->m_retxSuppression->m_initialInterval == RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL);
- BOOST_TEST(strategy->m_retxSuppression->m_maxInterval == RetxSuppressionExponential::DEFAULT_MAX_INTERVAL);
- BOOST_TEST(strategy->m_retxSuppression->m_multiplier == RetxSuppressionExponential::DEFAULT_MULTIPLIER);
+ BOOST_TEST(strategy->m_retxSuppression->m_initialInterval == fw::RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL);
+ BOOST_TEST(strategy->m_retxSuppression->m_maxInterval == fw::RetxSuppressionExponential::DEFAULT_MAX_INTERVAL);
+ BOOST_TEST(strategy->m_retxSuppression->m_multiplier == fw::RetxSuppressionExponential::DEFAULT_MULTIPLIER);
checkValidity("/probing-interval~500", false); // minimum is 1 second
checkValidity("/probing-interval~-5000", false);
@@ -591,7 +588,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestAsfStrategy
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace asf
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/best-route-strategy.t.cpp b/tests/daemon/fw/best-route-strategy.t.cpp
index d829e98..efaf90c 100644
--- a/tests/daemon/fw/best-route-strategy.t.cpp
+++ b/tests/daemon/fw/best-route-strategy.t.cpp
@@ -30,11 +30,9 @@
#include "tests/daemon/face/dummy-face.hpp"
#include "strategy-tester.hpp"
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
-using BestRouteStrategyTester = StrategyTester<BestRouteStrategy>;
+using BestRouteStrategyTester = StrategyTester<fw::BestRouteStrategy>;
NFD_REGISTER_STRATEGY(BestRouteStrategyTester);
BOOST_AUTO_TEST_SUITE(Fw)
@@ -83,7 +81,7 @@
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
const auto TICK = time::duration_cast<time::nanoseconds>(
- RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL * 0.1);
+ fw::RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL * 0.1);
// first Interest goes to nexthop with lowest FIB cost,
// however face1 is downstream so it cannot be used
@@ -114,7 +112,7 @@
retxFrom4Evt = getScheduler().schedule(TICK * 5, periodicalRetxFrom4);
};
periodicalRetxFrom4();
- this->advanceClocks(TICK, RetxSuppressionExponential::DEFAULT_MAX_INTERVAL * 16);
+ this->advanceClocks(TICK, fw::RetxSuppressionExponential::DEFAULT_MAX_INTERVAL * 16);
retxFrom4Evt.cancel();
// nexthops for accepted retransmissions: follow FIB cost,
@@ -130,7 +128,7 @@
strategy.sendInterestHistory.clear();
for (int i = 0; i < 3; ++i) {
- this->advanceClocks(TICK, RetxSuppressionExponential::DEFAULT_MAX_INTERVAL * 2);
+ this->advanceClocks(TICK, fw::RetxSuppressionExponential::DEFAULT_MAX_INTERVAL * 2);
pitEntry->insertOrUpdateInRecord(*face5, *interest);
strategy.afterReceiveInterest(*interest, FaceEndpoint(*face5, 0), pitEntry);
}
@@ -144,6 +142,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestBestRouteStrategy
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/choose-strategy.hpp b/tests/daemon/fw/choose-strategy.hpp
index cfb5ee6..5416384 100644
--- a/tests/daemon/fw/choose-strategy.hpp
+++ b/tests/daemon/fw/choose-strategy.hpp
@@ -31,12 +31,11 @@
#include <boost/lexical_cast.hpp>
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
class Strategy;
-} // namespace fw
+} // namespace nfd::fw
-namespace tests {
+namespace nfd::tests {
/** \brief choose the strategy for a namespace
* \tparam S strategy type, must be a complete type
@@ -60,7 +59,6 @@
return dynamic_cast<S&>(sc.findEffectiveStrategy(prefix));
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FW_CHOOSE_STRATEGY_HPP
diff --git a/tests/daemon/fw/dummy-strategy.cpp b/tests/daemon/fw/dummy-strategy.cpp
index 439efd1..a76b5e9 100644
--- a/tests/daemon/fw/dummy-strategy.cpp
+++ b/tests/daemon/fw/dummy-strategy.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -25,8 +25,7 @@
#include "dummy-strategy.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
NFD_REGISTER_STRATEGY(DummyStrategy);
@@ -106,5 +105,4 @@
Strategy::afterNewNextHop(nextHop, pitEntry);
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/dummy-strategy.hpp b/tests/daemon/fw/dummy-strategy.hpp
index f24d990..6785cc6 100644
--- a/tests/daemon/fw/dummy-strategy.hpp
+++ b/tests/daemon/fw/dummy-strategy.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -28,15 +28,15 @@
#include "fw/strategy.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
-/** \brief Forwarding strategy for unit testing
+/**
+ * \brief Forwarding strategy for unit testing
*
- * Triggers are recorded but do nothing.
+ * Triggers are recorded but do nothing.
*
- * DummyStrategy registers itself as /dummy-strategy/<max-version>, so that it can be instantiated
- * with any version number. Aliases can be created with the registerAs() function.
+ * DummyStrategy registers itself as `/dummy-strategy/<max-version>`, so that it can be instantiated
+ * with any version number. Aliases can be created with the registerAs() function.
*/
class DummyStrategy : public fw::Strategy
{
@@ -111,7 +111,8 @@
shared_ptr<Face> interestOutFace;
};
-/** \brief DummyStrategy with specific version
+/**
+ * \brief DummyStrategy with specific version
*/
template<uint64_t VERSION>
class VersionedDummyStrategy : public DummyStrategy
@@ -141,7 +142,6 @@
}
};
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FW_DUMMY_STRATEGY_HPP
diff --git a/tests/daemon/fw/face-table.t.cpp b/tests/daemon/fw/face-table.t.cpp
index fc2e7ee..a76ceed 100644
--- a/tests/daemon/fw/face-table.t.cpp
+++ b/tests/daemon/fw/face-table.t.cpp
@@ -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,
@@ -29,8 +29,7 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/face/dummy-face.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_FIXTURE_TEST_SUITE(TestFaceTable, GlobalIoFixture)
@@ -140,5 +139,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFaceTable
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/forwarder.t.cpp b/tests/daemon/fw/forwarder.t.cpp
index eef2cea..98f767f 100644
--- a/tests/daemon/fw/forwarder.t.cpp
+++ b/tests/daemon/fw/forwarder.t.cpp
@@ -34,8 +34,7 @@
#include <ndn-cxx/lp/tags.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class ForwarderFixture : public GlobalIoTimeFixture
{
@@ -881,5 +880,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestForwarder
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/forwarding-hint.t.cpp b/tests/daemon/fw/forwarding-hint.t.cpp
index d330395..ce7c414 100644
--- a/tests/daemon/fw/forwarding-hint.t.cpp
+++ b/tests/daemon/fw/forwarding-hint.t.cpp
@@ -28,11 +28,7 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "topology-tester.hpp"
-namespace nfd {
-namespace fw {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
#define CHECK_FH_EQUAL(actual, ...) \
do { \
@@ -76,7 +72,7 @@
nodeS = topo.addForwarder("spurs");
nodeQ = topo.addForwarder("serverQ");
for (auto node : {nodeA, nodeH, nodeT, nodeP, nodeC, nodeS, nodeQ}) {
- topo.setStrategy<BestRouteStrategy>(node);
+ topo.setStrategy<fw::BestRouteStrategy>(node);
}
topo.getForwarder(nodeH).getNetworkRegionTable().insert("/arizona/cs/hobo");
@@ -192,6 +188,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestForwardingHint
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/multicast-strategy.t.cpp b/tests/daemon/fw/multicast-strategy.t.cpp
index dbb8e52..3b91c63 100644
--- a/tests/daemon/fw/multicast-strategy.t.cpp
+++ b/tests/daemon/fw/multicast-strategy.t.cpp
@@ -32,11 +32,9 @@
#include "strategy-tester.hpp"
#include "topology-tester.hpp"
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
-using MulticastStrategyTester = StrategyTester<MulticastStrategy>;
+using MulticastStrategyTester = StrategyTester<fw::MulticastStrategy>;
NFD_REGISTER_STRATEGY(MulticastStrategyTester);
class MulticastStrategyFixture : public GlobalIoTimeFixture
@@ -117,7 +115,7 @@
nodeC = topo.addForwarder("C");
for (TopologyNode node : {nodeA, nodeB, nodeC}) {
- topo.setStrategy<MulticastStrategy>(node);
+ topo.setStrategy<fw::MulticastStrategy>(node);
}
shared_ptr<TopologyLink> linkAB = topo.addLink("AB", 10_ms, {nodeA, nodeB}),
@@ -171,7 +169,7 @@
BOOST_TEST(didSendInterestTo(*face2));
const auto TICK = time::duration_cast<time::nanoseconds>(
- RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL) / 10;
+ fw::RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL) / 10;
// downstream retransmits frequently, but the strategy should not send Interests
// more often than DEFAULT_MIN_RETX_INTERVAL
@@ -196,7 +194,7 @@
retxFrom4Evt = getScheduler().schedule(TICK * 5, periodicalRetxFrom4);
};
periodicalRetxFrom4();
- this->advanceClocks(TICK, RetxSuppressionExponential::DEFAULT_MAX_INTERVAL * 16);
+ this->advanceClocks(TICK, fw::RetxSuppressionExponential::DEFAULT_MAX_INTERVAL * 16);
retxFrom4Evt.cancel();
}
@@ -216,7 +214,7 @@
BOOST_AUTO_TEST_CASE(RetxSuppression)
{
- const auto suppressPeriod = RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL;
+ const auto suppressPeriod = fw::RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL;
BOOST_ASSERT(suppressPeriod >= 8_ms);
// Set up the FIB
@@ -510,6 +508,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestMulticastStrategy
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/pit-expiry.t.cpp b/tests/daemon/fw/pit-expiry.t.cpp
index 099d031..c2b6c41 100644
--- a/tests/daemon/fw/pit-expiry.t.cpp
+++ b/tests/daemon/fw/pit-expiry.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -31,11 +31,7 @@
#include <ndn-cxx/lp/tags.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_FIXTURE_TEST_SUITE(TestPitExpiry, GlobalIoTimeFixture)
@@ -415,6 +411,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestPitExpiry
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/pit-token.t.cpp b/tests/daemon/fw/pit-token.t.cpp
index f595ee7..1bf6968 100644
--- a/tests/daemon/fw/pit-token.t.cpp
+++ b/tests/daemon/fw/pit-token.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, 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,
@@ -29,11 +29,7 @@
#include <ndn-cxx/lp/packet.hpp>
#include <ndn-cxx/lp/pit-token.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_AUTO_TEST_SUITE(TestPitToken)
@@ -89,6 +85,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestPitToken
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/random-strategy.t.cpp b/tests/daemon/fw/random-strategy.t.cpp
index d2291c5..b89d48c 100644
--- a/tests/daemon/fw/random-strategy.t.cpp
+++ b/tests/daemon/fw/random-strategy.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -30,11 +30,9 @@
#include "tests/daemon/face/dummy-face.hpp"
#include "strategy-tester.hpp"
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
-using RandomStrategyTester = StrategyTester<RandomStrategy>;
+using RandomStrategyTester = StrategyTester<fw::RandomStrategy>;
NFD_REGISTER_STRATEGY(RandomStrategyTester);
BOOST_AUTO_TEST_SUITE(Fw)
@@ -100,6 +98,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestRandomStrategy
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/retx-suppression.t.cpp b/tests/daemon/fw/retx-suppression.t.cpp
index 3a2cf06..d662251 100644
--- a/tests/daemon/fw/retx-suppression.t.cpp
+++ b/tests/daemon/fw/retx-suppression.t.cpp
@@ -23,7 +23,6 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "fw/strategy.hpp"
#include "fw/retx-suppression-fixed.hpp"
#include "fw/retx-suppression-exponential.hpp"
@@ -31,11 +30,9 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/face/dummy-face.hpp"
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::fw;
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_FIXTURE_TEST_SUITE(TestRetxSuppression, GlobalIoTimeFixture)
@@ -203,6 +200,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestRetxSuppression
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/strategy-ad-hoc-face.t.cpp b/tests/daemon/fw/strategy-ad-hoc-face.t.cpp
index bdf0cb6..cd46054 100644
--- a/tests/daemon/fw/strategy-ad-hoc-face.t.cpp
+++ b/tests/daemon/fw/strategy-ad-hoc-face.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -39,9 +39,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::fw;
template<typename S>
class AdHocTopologyFixture : public GlobalIoTimeFixture
@@ -151,6 +151,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyAdHocFace
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/strategy-broadcast-medium.t.cpp b/tests/daemon/fw/strategy-broadcast-medium.t.cpp
index 6a45b2e..113faf5 100644
--- a/tests/daemon/fw/strategy-broadcast-medium.t.cpp
+++ b/tests/daemon/fw/strategy-broadcast-medium.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -40,9 +40,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::fw;
template<typename S>
class BroadcastMediumFixture : public GlobalIoTimeFixture
@@ -125,6 +125,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyBroadcastMedium
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/strategy-instantiation.t.cpp b/tests/daemon/fw/strategy-instantiation.t.cpp
index 3ce458a..12c13a1 100644
--- a/tests/daemon/fw/strategy-instantiation.t.cpp
+++ b/tests/daemon/fw/strategy-instantiation.t.cpp
@@ -39,9 +39,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::fw;
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_AUTO_TEST_SUITE(TestStrategyInstantiation)
@@ -202,6 +202,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyInstantiation
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/strategy-nack-return.t.cpp b/tests/daemon/fw/strategy-nack-return.t.cpp
index b928c92..9dcd0c9 100644
--- a/tests/daemon/fw/strategy-nack-return.t.cpp
+++ b/tests/daemon/fw/strategy-nack-return.t.cpp
@@ -37,9 +37,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::fw;
template<typename S>
class StrategyNackReturnFixture : public GlobalIoTimeFixture
@@ -337,6 +337,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyNackReturn
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/strategy-no-route.t.cpp b/tests/daemon/fw/strategy-no-route.t.cpp
index cec64c4..4fab4e5 100644
--- a/tests/daemon/fw/strategy-no-route.t.cpp
+++ b/tests/daemon/fw/strategy-no-route.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -41,9 +41,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::fw;
template<typename S>
class StrategyNoRouteFixture : public GlobalIoTimeFixture
@@ -183,6 +183,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyNoRoute
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/strategy-scope-control.t.cpp b/tests/daemon/fw/strategy-scope-control.t.cpp
index 86e9540..d44460f 100644
--- a/tests/daemon/fw/strategy-scope-control.t.cpp
+++ b/tests/daemon/fw/strategy-scope-control.t.cpp
@@ -41,9 +41,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::fw;
template<typename S>
class StrategyScopeControlFixture : public GlobalIoTimeFixture
@@ -275,6 +275,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyScopeControl
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/strategy-tester.hpp b/tests/daemon/fw/strategy-tester.hpp
index 5391dde..e8e795a 100644
--- a/tests/daemon/fw/strategy-tester.hpp
+++ b/tests/daemon/fw/strategy-tester.hpp
@@ -30,11 +30,7 @@
#include "tests/daemon/limited-io.hpp"
-namespace nfd {
-namespace fw {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
/** \brief Extends strategy S for unit testing.
*
@@ -154,8 +150,6 @@
std::vector<SendNackArgs> sendNackHistory;
};
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FW_STRATEGY_TESTER_HPP
diff --git a/tests/daemon/fw/strategy.t.cpp b/tests/daemon/fw/strategy.t.cpp
index 82191f7..c1fdabd 100644
--- a/tests/daemon/fw/strategy.t.cpp
+++ b/tests/daemon/fw/strategy.t.cpp
@@ -34,11 +34,9 @@
#include <boost/range/adaptor/transformed.hpp>
#include <boost/range/algorithm/copy.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::fw;
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_FIXTURE_TEST_SUITE(TestStrategy, GlobalIoFixture)
@@ -126,6 +124,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategy
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/topology-tester.cpp b/tests/daemon/fw/topology-tester.cpp
index c44d61d..a758ee2 100644
--- a/tests/daemon/fw/topology-tester.cpp
+++ b/tests/daemon/fw/topology-tester.cpp
@@ -30,9 +30,7 @@
#include <ndn-cxx/encoding/encoding-buffer-fwd.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
using face::GenericLinkService;
using face::InternalClientTransport;
@@ -324,6 +322,4 @@
}
}
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/topology-tester.hpp b/tests/daemon/fw/topology-tester.hpp
index 842e810..5d97392 100644
--- a/tests/daemon/fw/topology-tester.hpp
+++ b/tests/daemon/fw/topology-tester.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -38,11 +38,7 @@
#include <ndn-cxx/face.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
/** \brief identifies a node (forwarder) in the topology
*/
@@ -367,8 +363,6 @@
bool m_wantPcap = false;
};
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FW_TOPOLOGY_TESTER_HPP
diff --git a/tests/daemon/fw/unsolicited-data-policy.t.cpp b/tests/daemon/fw/unsolicited-data-policy.t.cpp
index 77722c7..ee5ae77 100644
--- a/tests/daemon/fw/unsolicited-data-policy.t.cpp
+++ b/tests/daemon/fw/unsolicited-data-policy.t.cpp
@@ -33,11 +33,9 @@
#include <boost/logic/tribool.hpp>
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::fw;
class UnsolicitedDataPolicyFixture : public GlobalIoTimeFixture
{
@@ -131,6 +129,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestUnsolicitedDataPolicy
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/global-io-fixture.cpp b/tests/daemon/global-io-fixture.cpp
index 3a85e29..05aa8a1 100644
--- a/tests/daemon/global-io-fixture.cpp
+++ b/tests/daemon/global-io-fixture.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, 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,
@@ -26,8 +26,7 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
GlobalIoFixture::GlobalIoFixture()
: g_io(getGlobalIoService())
@@ -58,5 +57,4 @@
pollIo();
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/global-io-fixture.hpp b/tests/daemon/global-io-fixture.hpp
index 7ac4f74..e374ec0 100644
--- a/tests/daemon/global-io-fixture.hpp
+++ b/tests/daemon/global-io-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, 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,
@@ -28,8 +28,7 @@
#include "tests/clock-fixture.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
/** \brief A fixture providing proper setup and teardown of the global io_service.
*
@@ -63,7 +62,6 @@
afterTick() final;
};
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_GLOBAL_IO_FIXTURE_HPP
diff --git a/tests/daemon/limited-io.cpp b/tests/daemon/limited-io.cpp
index c7e9b1b..9f10f99 100644
--- a/tests/daemon/limited-io.cpp
+++ b/tests/daemon/limited-io.cpp
@@ -29,8 +29,7 @@
#include <boost/exception/diagnostic_information.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
LimitedIo::LimitedIo(GlobalIoTimeFixture* fixture)
: m_fixture(fixture)
@@ -107,5 +106,4 @@
}
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/limited-io.hpp b/tests/daemon/limited-io.hpp
index efa35c9..68d85e2 100644
--- a/tests/daemon/limited-io.hpp
+++ b/tests/daemon/limited-io.hpp
@@ -30,8 +30,7 @@
#include <exception>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
/** \brief Provides IO operations limit and/or time limit for unit testing.
*
@@ -61,21 +60,22 @@
* \param tick if this LimitedIo is constructed with GlobalIoTimeFixture,
* this is passed to .advanceClocks(), otherwise ignored
*/
- StopReason
+ [[nodiscard]] StopReason
run(int nOpsLimit, time::nanoseconds timeLimit, time::nanoseconds tick = 1_ms);
- /// count an operation
+ /// Count an operation
void
afterOp();
- /** \brief defer for specified duration
+ /**
+ * \brief Defer for the specified duration
*
- * equivalent to .run(UNLIMITED_OPS, d)
+ * Equivalent to run(UNLIMITED_OPS, d)
*/
void
defer(time::nanoseconds d)
{
- this->run(UNLIMITED_OPS, d);
+ std::ignore = run(UNLIMITED_OPS, d);
}
std::exception_ptr
@@ -107,7 +107,6 @@
bool m_isRunning = false;
};
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_LIMITED_IO_HPP
diff --git a/tests/daemon/mgmt/command-authenticator.t.cpp b/tests/daemon/mgmt/command-authenticator.t.cpp
index 7db02ca..051d7c9 100644
--- a/tests/daemon/mgmt/command-authenticator.t.cpp
+++ b/tests/daemon/mgmt/command-authenticator.t.cpp
@@ -29,8 +29,7 @@
#include <boost/filesystem.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class CommandAuthenticatorFixture : public CommandInterestSignerFixture
{
@@ -468,5 +467,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestCommandAuthenticator
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/cs-manager.t.cpp b/tests/daemon/mgmt/cs-manager.t.cpp
index 3f6b3aa..4f7b51b 100644
--- a/tests/daemon/mgmt/cs-manager.t.cpp
+++ b/tests/daemon/mgmt/cs-manager.t.cpp
@@ -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,
@@ -29,8 +29,7 @@
#include <ndn-cxx/mgmt/nfd/cs-info.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class CsManagerFixture : public ManagerFixtureWithAuthenticator
{
@@ -226,5 +225,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestCsManager
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/face-manager-command-fixture.cpp b/tests/daemon/mgmt/face-manager-command-fixture.cpp
index ed90d0a..694870e 100644
--- a/tests/daemon/mgmt/face-manager-command-fixture.cpp
+++ b/tests/daemon/mgmt/face-manager-command-fixture.cpp
@@ -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,
@@ -28,8 +28,7 @@
#include <ndn-cxx/net/network-monitor-stub.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
FaceManagerCommandNode::FaceManagerCommandNode(ndn::KeyChain& keyChain, uint16_t port)
: face(getGlobalIoService(), keyChain, {true, true})
@@ -118,5 +117,4 @@
advanceClocks(1_ms, 5);
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/face-manager-command-fixture.hpp b/tests/daemon/mgmt/face-manager-command-fixture.hpp
index 5864ad2..de28f3b 100644
--- a/tests/daemon/mgmt/face-manager-command-fixture.hpp
+++ b/tests/daemon/mgmt/face-manager-command-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,
@@ -31,8 +31,7 @@
#include "manager-common-fixture.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class FaceManagerCommandNode
{
@@ -70,7 +69,6 @@
FaceManagerCommandNode node2; // acts as a remote endpoint
};
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_MGMT_FACE_MANAGER_COMMAND_FIXTURE_HPP
diff --git a/tests/daemon/mgmt/face-manager-create-face.t.cpp b/tests/daemon/mgmt/face-manager-create-face.t.cpp
index 7c0fe6f..45ddc1f 100644
--- a/tests/daemon/mgmt/face-manager-create-face.t.cpp
+++ b/tests/daemon/mgmt/face-manager-create-face.t.cpp
@@ -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,
@@ -30,8 +30,7 @@
#include "face/generic-link-service.hpp"
#include "face-manager-command-fixture.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Mgmt)
BOOST_AUTO_TEST_SUITE(TestFaceManager)
@@ -477,5 +476,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFaceManager
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/face-manager-update-face.t.cpp b/tests/daemon/mgmt/face-manager-update-face.t.cpp
index 89031fd..6000380 100644
--- a/tests/daemon/mgmt/face-manager-update-face.t.cpp
+++ b/tests/daemon/mgmt/face-manager-update-face.t.cpp
@@ -35,8 +35,7 @@
#include <boost/logic/tribool.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Mgmt)
BOOST_AUTO_TEST_SUITE(TestFaceManager)
@@ -203,7 +202,6 @@
});
}
-using nfd::face::tests::DummyTransportBase;
using UpdatePersistencyTests = mpl::vector<
mpl::pair<DummyTransportBase<true>, CommandSuccess>,
mpl::pair<DummyTransportBase<false>, CommandFailure<409>>
@@ -737,5 +735,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFaceManager
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/face-manager.t.cpp b/tests/daemon/mgmt/face-manager.t.cpp
index 828325f..794c363 100644
--- a/tests/daemon/mgmt/face-manager.t.cpp
+++ b/tests/daemon/mgmt/face-manager.t.cpp
@@ -39,8 +39,7 @@
#include <ndn-cxx/net/network-monitor-stub.hpp>
#include <ndn-cxx/util/random.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class FaceManagerFixture : public ManagerFixtureWithAuthenticator
{
@@ -369,7 +368,7 @@
FaceId faceId = face->getId();
// trigger FACE_EVENT_DOWN notification
- dynamic_cast<face::tests::DummyTransport*>(face->getTransport())->setState(face::FaceState::DOWN);
+ dynamic_cast<DummyTransport*>(face->getTransport())->setState(face::FaceState::DOWN);
advanceClocks(1_ms, 10);
BOOST_CHECK_EQUAL(face->getState(), face::FaceState::DOWN);
@@ -390,7 +389,7 @@
}
// trigger FACE_EVENT_UP notification
- dynamic_cast<face::tests::DummyTransport*>(face->getTransport())->setState(face::FaceState::UP);
+ dynamic_cast<DummyTransport*>(face->getTransport())->setState(face::FaceState::UP);
advanceClocks(1_ms, 10);
BOOST_CHECK_EQUAL(face->getState(), face::FaceState::UP);
@@ -445,5 +444,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFaceManager
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/fib-manager.t.cpp b/tests/daemon/mgmt/fib-manager.t.cpp
index 544eda5..5ab310d 100644
--- a/tests/daemon/mgmt/fib-manager.t.cpp
+++ b/tests/daemon/mgmt/fib-manager.t.cpp
@@ -32,8 +32,7 @@
#include <ndn-cxx/lp/tags.hpp>
#include <ndn-cxx/mgmt/nfd/fib-entry.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class FibManagerFixture : public ManagerFixtureWithAuthenticator
{
@@ -446,5 +445,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFibManager
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/forwarder-status-manager.t.cpp b/tests/daemon/mgmt/forwarder-status-manager.t.cpp
index 132375a..e40a0ce 100644
--- a/tests/daemon/mgmt/forwarder-status-manager.t.cpp
+++ b/tests/daemon/mgmt/forwarder-status-manager.t.cpp
@@ -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,
@@ -28,8 +28,7 @@
#include "manager-common-fixture.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class ForwarderStatusManagerFixture : public ManagerCommonFixture
{
@@ -111,5 +110,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestForwarderStatusManager
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/general-config-section.t.cpp b/tests/daemon/mgmt/general-config-section.t.cpp
index cad7834..d06d698 100644
--- a/tests/daemon/mgmt/general-config-section.t.cpp
+++ b/tests/daemon/mgmt/general-config-section.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -32,18 +32,14 @@
#include <cstring>
-namespace nfd {
-namespace general {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
class GeneralConfigSectionFixture : public GlobalIoFixture
{
public:
GeneralConfigSectionFixture()
{
- setConfigFile(configFile);
+ general::setConfigFile(configFile);
}
#ifdef NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
@@ -163,6 +159,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestGeneralConfigSection
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace general
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/manager-base.t.cpp b/tests/daemon/mgmt/manager-base.t.cpp
index a70784c..dba2dd8 100644
--- a/tests/daemon/mgmt/manager-base.t.cpp
+++ b/tests/daemon/mgmt/manager-base.t.cpp
@@ -32,8 +32,7 @@
#include <ndn-cxx/security/pib/key.hpp>
#include <ndn-cxx/security/pib/pib.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class TestCommandVoidParameters : public ControlCommand
{
@@ -168,5 +167,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestManagerBase
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/manager-common-fixture.cpp b/tests/daemon/mgmt/manager-common-fixture.cpp
index 3188ee4..8be600c 100644
--- a/tests/daemon/mgmt/manager-common-fixture.cpp
+++ b/tests/daemon/mgmt/manager-common-fixture.cpp
@@ -25,8 +25,7 @@
#include "manager-common-fixture.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
CommandInterestSignerFixture::CommandInterestSignerFixture()
: m_signer(m_keyChain)
@@ -212,5 +211,4 @@
cf.parse(config, false, "ManagerCommonFixture.authenticator.conf");
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/manager-common-fixture.hpp b/tests/daemon/mgmt/manager-common-fixture.hpp
index 005d456..79923a0 100644
--- a/tests/daemon/mgmt/manager-common-fixture.hpp
+++ b/tests/daemon/mgmt/manager-common-fixture.hpp
@@ -36,8 +36,7 @@
#include <ndn-cxx/security/interest-signer.hpp>
#include <ndn-cxx/util/dummy-client-face.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
/** \brief A fixture that wraps an InterestSigner.
*/
@@ -201,7 +200,6 @@
}
};
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_MGMT_MANAGER_COMMON_FIXTURE_HPP
diff --git a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
index ebfe7d0..b085657 100644
--- a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
+++ b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
@@ -37,8 +37,7 @@
#include <boost/property_tree/info_parser.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
using rib::Route;
@@ -182,7 +181,7 @@
ndn::util::DummyClientFace m_face;
ndn::nfd::Controller m_nfdController;
Dispatcher m_dispatcher;
- rib::tests::MockFibUpdater m_fibUpdater;
+ MockFibUpdater m_fibUpdater;
ndn::security::SigningInfo m_trustedSigner;
ndn::security::SigningInfo m_untrustedSigner;
@@ -376,5 +375,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestRibManager
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/rib-manager.t.cpp b/tests/daemon/mgmt/rib-manager.t.cpp
index be4638f..9a06393 100644
--- a/tests/daemon/mgmt/rib-manager.t.cpp
+++ b/tests/daemon/mgmt/rib-manager.t.cpp
@@ -34,8 +34,7 @@
#include <boost/property_tree/info_parser.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
struct ConfigurationStatus
{
@@ -237,7 +236,7 @@
ndn::nfd::Controller m_nfdController;
rib::Rib m_rib;
- rib::tests::MockFibUpdater m_fibUpdater;
+ MockFibUpdater m_fibUpdater;
RibManager m_manager;
};
@@ -561,5 +560,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestRibManager
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/strategy-choice-manager.t.cpp b/tests/daemon/mgmt/strategy-choice-manager.t.cpp
index 3e42d1c..71763bb 100644
--- a/tests/daemon/mgmt/strategy-choice-manager.t.cpp
+++ b/tests/daemon/mgmt/strategy-choice-manager.t.cpp
@@ -31,8 +31,7 @@
#include <ndn-cxx/mgmt/nfd/strategy-choice.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class StrategyChoiceManagerFixture : public ManagerFixtureWithAuthenticator
{
@@ -239,5 +238,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyChoiceManager
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/tables-config-section.t.cpp b/tests/daemon/mgmt/tables-config-section.t.cpp
index 4f07f78..dd0133f 100644
--- a/tests/daemon/mgmt/tables-config-section.t.cpp
+++ b/tests/daemon/mgmt/tables-config-section.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -35,8 +35,7 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/fw/dummy-strategy.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class TablesConfigSectionFixture : public GlobalIoFixture
{
@@ -485,5 +484,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestTablesConfigSection
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib-io-fixture.cpp b/tests/daemon/rib-io-fixture.cpp
index 66b347b..d8931df 100644
--- a/tests/daemon/rib-io-fixture.cpp
+++ b/tests/daemon/rib-io-fixture.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, 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,
@@ -29,8 +29,7 @@
#include <boost/exception/diagnostic_information.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
RibIoFixture::RibIoFixture()
{
@@ -128,5 +127,4 @@
poll();
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib-io-fixture.hpp b/tests/daemon/rib-io-fixture.hpp
index f8660fd..73a43bc 100644
--- a/tests/daemon/rib-io-fixture.hpp
+++ b/tests/daemon/rib-io-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, 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,
@@ -32,8 +32,7 @@
#include <mutex>
#include <thread>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
/** \brief A base test fixture that provides both main and RIB io_service.
*/
@@ -86,7 +85,6 @@
afterTick() final;
};
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_RIB_IO_FIXTURE_HPP
diff --git a/tests/daemon/rib/create-route.hpp b/tests/daemon/rib/create-route.hpp
index b248575..4e3fd57 100644
--- a/tests/daemon/rib/create-route.hpp
+++ b/tests/daemon/rib/create-route.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,
@@ -28,17 +28,15 @@
#include "rib/route.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-inline Route
+inline rib::Route
createRoute(uint64_t faceId,
std::underlying_type_t<ndn::nfd::RouteOrigin> origin,
uint64_t cost = 0,
std::underlying_type_t<ndn::nfd::RouteFlags> flags = ndn::nfd::ROUTE_FLAGS_NONE)
{
- Route r;
+ rib::Route r;
r.faceId = faceId;
r.origin = static_cast<ndn::nfd::RouteOrigin>(origin);
r.cost = cost;
@@ -46,8 +44,6 @@
return r;
}
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_RIB_CREATE_ROUTE_HPP
diff --git a/tests/daemon/rib/fib-updates-common.hpp b/tests/daemon/rib/fib-updates-common.hpp
index 1930d14..9ceaeab 100644
--- a/tests/daemon/rib/fib-updates-common.hpp
+++ b/tests/daemon/rib/fib-updates-common.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,
@@ -35,11 +35,10 @@
#include <ndn-cxx/util/dummy-client-face.hpp>
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using rib::FibUpdate;
+using rib::FibUpdater;
class MockFibUpdater : public FibUpdater
{
@@ -113,10 +112,10 @@
uint64_t cost,
std::underlying_type_t<ndn::nfd::RouteFlags> flags)
{
- Route route = createRoute(faceId, origin, cost, flags);
+ auto route = createRoute(faceId, origin, cost, flags);
- RibUpdate update;
- update.setAction(RibUpdate::REGISTER)
+ rib::RibUpdate update;
+ update.setAction(rib::RibUpdate::REGISTER)
.setName(name)
.setRoute(route);
@@ -128,10 +127,10 @@
eraseRoute(const Name& name, uint64_t faceId,
std::underlying_type_t<ndn::nfd::RouteOrigin> origin)
{
- Route route = createRoute(faceId, origin, 0, 0);
+ auto route = createRoute(faceId, origin, 0, 0);
- RibUpdate update;
- update.setAction(RibUpdate::UNREGISTER)
+ rib::RibUpdate update;
+ update.setAction(rib::RibUpdate::UNREGISTER)
.setName(name)
.setRoute(route);
@@ -169,12 +168,10 @@
ndn::util::DummyClientFace face;
ndn::nfd::Controller controller;
- Rib rib;
+ rib::Rib rib;
MockFibUpdater fibUpdater;
};
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_RIB_FIB_UPDATES_COMMON_HPP
diff --git a/tests/daemon/rib/fib-updates-erase-face.t.cpp b/tests/daemon/rib/fib-updates-erase-face.t.cpp
index d55f207..a911d5e 100644
--- a/tests/daemon/rib/fib-updates-erase-face.t.cpp
+++ b/tests/daemon/rib/fib-updates-erase-face.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016, 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,
@@ -28,9 +28,7 @@
#include "tests/test-common.hpp"
#include "fib-updates-common.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
BOOST_FIXTURE_TEST_SUITE(TestFibUpdates, FibUpdatesFixture)
@@ -426,6 +424,4 @@
BOOST_AUTO_TEST_SUITE_END() // FibUpdates
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/fib-updates-new-face.t.cpp b/tests/daemon/rib/fib-updates-new-face.t.cpp
index 49cd56f..79924df 100644
--- a/tests/daemon/rib/fib-updates-new-face.t.cpp
+++ b/tests/daemon/rib/fib-updates-new-face.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015, 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,
@@ -28,9 +28,7 @@
#include "tests/test-common.hpp"
#include "fib-updates-common.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
BOOST_FIXTURE_TEST_SUITE(TestFibUpdates, FibUpdatesFixture)
@@ -267,6 +265,4 @@
BOOST_AUTO_TEST_SUITE_END() // FibUpdates
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/fib-updates-new-namespace.t.cpp b/tests/daemon/rib/fib-updates-new-namespace.t.cpp
index 90abd31..4ceb60b 100644
--- a/tests/daemon/rib/fib-updates-new-namespace.t.cpp
+++ b/tests/daemon/rib/fib-updates-new-namespace.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015, 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,
@@ -28,9 +28,7 @@
#include "tests/test-common.hpp"
#include "fib-updates-common.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
BOOST_FIXTURE_TEST_SUITE(TestFibUpdates, FibUpdatesFixture)
@@ -195,6 +193,4 @@
BOOST_AUTO_TEST_SUITE_END() // FibUpdates
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/fib-updates-update-face.t.cpp b/tests/daemon/rib/fib-updates-update-face.t.cpp
index 54cd2d4..bb76d01 100644
--- a/tests/daemon/rib/fib-updates-update-face.t.cpp
+++ b/tests/daemon/rib/fib-updates-update-face.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015, 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,
@@ -28,9 +28,7 @@
#include "tests/test-common.hpp"
#include "fib-updates-common.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
BOOST_FIXTURE_TEST_SUITE(TestFibUpdates, FibUpdatesFixture)
@@ -261,6 +259,4 @@
BOOST_AUTO_TEST_SUITE_END() // FibUpdates
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp b/tests/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp
index b804725..eab14e8 100644
--- a/tests/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp
+++ b/tests/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp
@@ -28,11 +28,9 @@
#include "tests/test-common.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::rib;
BOOST_AUTO_TEST_SUITE(Readvertise)
BOOST_FIXTURE_TEST_SUITE(TestClientToNlsrReadvertisePolicy, GlobalIoFixture)
@@ -72,6 +70,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestClientToNlsrReadvertisePolicy
BOOST_AUTO_TEST_SUITE_END() // Readvertise
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp b/tests/daemon/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp
index c3682dd..df73058 100644
--- a/tests/daemon/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp
+++ b/tests/daemon/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp
@@ -29,11 +29,9 @@
#include "tests/key-chain-fixture.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::rib;
class HostToGatewayReadvertisePolicyFixture : public GlobalIoFixture, public KeyChainFixture
{
@@ -109,6 +107,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestHostToGatewayReadvertisePolicy
BOOST_AUTO_TEST_SUITE_END() // Readvertise
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp b/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
index 5a64bbe..36ca585 100644
--- a/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
+++ b/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
@@ -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,
@@ -32,11 +32,9 @@
#include <ndn-cxx/security/signing-info.hpp>
#include <ndn-cxx/util/dummy-client-face.hpp>
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::rib;
class NfdRibReadvertiseDestinationFixture : public GlobalIoTimeFixture, public KeyChainFixture
{
@@ -251,6 +249,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestNfdRibReadvertiseDestination
BOOST_AUTO_TEST_SUITE_END() // Readvertise
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/readvertise/readvertise.t.cpp b/tests/daemon/rib/readvertise/readvertise.t.cpp
index ffcab71..6242dfc 100644
--- a/tests/daemon/rib/readvertise/readvertise.t.cpp
+++ b/tests/daemon/rib/readvertise/readvertise.t.cpp
@@ -34,11 +34,9 @@
#include <boost/range/adaptor/transformed.hpp>
#include <boost/range/algorithm/copy.hpp>
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::rib;
class DummyReadvertisePolicy : public ReadvertisePolicy
{
@@ -300,6 +298,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestReadvertise
BOOST_AUTO_TEST_SUITE_END() // Readvertise
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/rib-entry.t.cpp b/tests/daemon/rib/rib-entry.t.cpp
index b946b78..903313e 100644
--- a/tests/daemon/rib/rib-entry.t.cpp
+++ b/tests/daemon/rib/rib-entry.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -28,21 +28,20 @@
#include "tests/test-common.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using rib::RibEntry;
+using rib::Route;
BOOST_FIXTURE_TEST_SUITE(TestRibEntry, GlobalIoFixture)
BOOST_AUTO_TEST_CASE(Basic)
{
- rib::RibEntry entry;
- rib::RibEntry::iterator entryIt;
+ RibEntry entry;
+ RibEntry::iterator entryIt;
bool didInsert = false;
- rib::Route route1;
+ Route route1;
route1.faceId = 1;
route1.origin = ndn::nfd::ROUTE_ORIGIN_APP;
@@ -172,6 +171,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestRibEntry
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/rib-update.t.cpp b/tests/daemon/rib/rib-update.t.cpp
index 90c80f0..533439a 100644
--- a/tests/daemon/rib/rib-update.t.cpp
+++ b/tests/daemon/rib/rib-update.t.cpp
@@ -29,9 +29,9 @@
#include "tests/test-common.hpp"
#include "tests/daemon/rib/create-route.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::rib;
BOOST_AUTO_TEST_SUITE(TestRibUpdate)
@@ -76,6 +76,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestRibUpdate
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/rib.t.cpp b/tests/daemon/rib/rib.t.cpp
index cc96e79..b635207 100644
--- a/tests/daemon/rib/rib.t.cpp
+++ b/tests/daemon/rib/rib.t.cpp
@@ -29,11 +29,9 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/rib/create-route.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using rib::Route;
BOOST_FIXTURE_TEST_SUITE(TestRib, GlobalIoFixture)
@@ -239,39 +237,37 @@
Route route1 = createRoute(1, 20, 10);
Route route2 = createRoute(2, 30, 20);
- RibRouteRef routeInfo;
-
int nAfterInsertEntryInvocations = 0;
int nAfterAddRouteInvocations = 0;
int nBeforeRemoveRouteInvocations = 0;
int nAfterEraseEntryInvocations = 0;
- rib.afterInsertEntry.connect([&] (const Name& inName) {
- BOOST_CHECK_EQUAL(nAfterInsertEntryInvocations, 0);
- BOOST_CHECK_EQUAL(nAfterAddRouteInvocations, 0);
- BOOST_CHECK(rib.find(name) != rib.end());
- nAfterInsertEntryInvocations++;
- });
+ rib.afterInsertEntry.connect([&] (const auto&) {
+ BOOST_CHECK_EQUAL(nAfterInsertEntryInvocations, 0);
+ BOOST_CHECK_EQUAL(nAfterAddRouteInvocations, 0);
+ BOOST_CHECK(rib.find(name) != rib.end());
+ nAfterInsertEntryInvocations++;
+ });
- rib.afterAddRoute.connect([&] (const RibRouteRef& rrr) {
- BOOST_CHECK_EQUAL(nAfterInsertEntryInvocations, 1);
- BOOST_CHECK(rib.find(name) != rib.end());
- BOOST_CHECK(rib.find(name, route) != nullptr);
- nAfterAddRouteInvocations++;
- });
+ rib.afterAddRoute.connect([&] (const auto&) {
+ BOOST_CHECK_EQUAL(nAfterInsertEntryInvocations, 1);
+ BOOST_CHECK(rib.find(name) != rib.end());
+ BOOST_CHECK(rib.find(name, route) != nullptr);
+ nAfterAddRouteInvocations++;
+ });
- rib.beforeRemoveRoute.connect([&] (const RibRouteRef& rrr) {
- BOOST_CHECK_EQUAL(nAfterEraseEntryInvocations, 0);
- BOOST_CHECK(rib.find(name) != rib.end());
- BOOST_CHECK(rib.find(name, route) != nullptr);
- nBeforeRemoveRouteInvocations++;
- });
+ rib.beforeRemoveRoute.connect([&] (const auto&) {
+ BOOST_CHECK_EQUAL(nAfterEraseEntryInvocations, 0);
+ BOOST_CHECK(rib.find(name) != rib.end());
+ BOOST_CHECK(rib.find(name, route) != nullptr);
+ nBeforeRemoveRouteInvocations++;
+ });
- rib.afterEraseEntry.connect([&] (const Name& inName) {
- BOOST_CHECK_EQUAL(nBeforeRemoveRouteInvocations, 2);
- BOOST_CHECK_EQUAL(nAfterEraseEntryInvocations, 0);
- BOOST_CHECK(rib.find(name) == rib.end());
- nAfterEraseEntryInvocations++;
- });
+ rib.afterEraseEntry.connect([&] (const auto&) {
+ BOOST_CHECK_EQUAL(nBeforeRemoveRouteInvocations, 2);
+ BOOST_CHECK_EQUAL(nAfterEraseEntryInvocations, 0);
+ BOOST_CHECK(rib.find(name) == rib.end());
+ nAfterEraseEntryInvocations++;
+ });
route = route1;
rib.insert(name, route);
@@ -333,6 +329,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestRib
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/route.t.cpp b/tests/daemon/rib/route.t.cpp
index 011ce7e..910e641 100644
--- a/tests/daemon/rib/route.t.cpp
+++ b/tests/daemon/rib/route.t.cpp
@@ -28,11 +28,9 @@
#include "tests/test-common.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using rib::Route;
BOOST_FIXTURE_TEST_SUITE(TestRoute, GlobalIoTimeFixture)
@@ -161,6 +159,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestRoute
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/service.t.cpp b/tests/daemon/rib/service.t.cpp
index caa59d3..5b808cc 100644
--- a/tests/daemon/rib/service.t.cpp
+++ b/tests/daemon/rib/service.t.cpp
@@ -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,
@@ -32,11 +32,9 @@
#include <boost/property_tree/info_parser.hpp>
#include <sstream>
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using rib::Service;
class RibServiceFixture : public RibIoFixture
{
@@ -147,6 +145,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestService
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/cleanup.t.cpp b/tests/daemon/table/cleanup.t.cpp
index b7395a3..1631b9c 100644
--- a/tests/daemon/table/cleanup.t.cpp
+++ b/tests/daemon/table/cleanup.t.cpp
@@ -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,
@@ -30,8 +30,7 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/face/dummy-face.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Table)
BOOST_FIXTURE_TEST_SUITE(TestCleanup, GlobalIoFixture)
@@ -183,5 +182,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestCleanup
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/cs-fixture.hpp b/tests/daemon/table/cs-fixture.hpp
index 82fbb7e..30273d3 100644
--- a/tests/daemon/table/cs-fixture.hpp
+++ b/tests/daemon/table/cs-fixture.hpp
@@ -33,13 +33,9 @@
#include <cstring>
-namespace nfd {
-namespace cs {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
-
-#define CHECK_CS_FIND(expected) find([&] (uint32_t found) { BOOST_CHECK_EQUAL(expected, found); });
+#define CHECK_CS_FIND(expected) find([&] (uint32_t found) { BOOST_CHECK_EQUAL(expected, found); })
class CsFixture : public GlobalIoTimeFixture
{
@@ -105,8 +101,6 @@
shared_ptr<Interest> interest;
};
-} // namespace tests
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_TABLE_CS_FIXTURE_HPP
diff --git a/tests/daemon/table/cs-policy-lru.t.cpp b/tests/daemon/table/cs-policy-lru.t.cpp
index ed4fa7c..ce19f94 100644
--- a/tests/daemon/table/cs-policy-lru.t.cpp
+++ b/tests/daemon/table/cs-policy-lru.t.cpp
@@ -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,
@@ -27,22 +27,20 @@
#include "tests/daemon/table/cs-fixture.hpp"
-namespace nfd {
-namespace cs {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Table)
BOOST_AUTO_TEST_SUITE(TestCsLru)
BOOST_AUTO_TEST_CASE(Registration)
{
- std::set<std::string> policyNames = Policy::getPolicyNames();
+ std::set<std::string> policyNames = cs::Policy::getPolicyNames();
BOOST_CHECK_EQUAL(policyNames.count("lru"), 1);
}
BOOST_FIXTURE_TEST_CASE(EvictOne, CsFixture)
{
- cs.setPolicy(make_unique<LruPolicy>());
+ cs.setPolicy(make_unique<cs::LruPolicy>());
cs.setLimit(3);
insert(1, "/A");
@@ -84,6 +82,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestCsLru
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/cs-policy-priority-fifo.t.cpp b/tests/daemon/table/cs-policy-priority-fifo.t.cpp
index c059756..a1c88d0 100644
--- a/tests/daemon/table/cs-policy-priority-fifo.t.cpp
+++ b/tests/daemon/table/cs-policy-priority-fifo.t.cpp
@@ -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,
@@ -27,22 +27,20 @@
#include "tests/daemon/table/cs-fixture.hpp"
-namespace nfd {
-namespace cs {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Table)
BOOST_AUTO_TEST_SUITE(TestCsPriorityFifo)
BOOST_AUTO_TEST_CASE(Registration)
{
- std::set<std::string> policyNames = Policy::getPolicyNames();
+ std::set<std::string> policyNames = cs::Policy::getPolicyNames();
BOOST_CHECK_EQUAL(policyNames.count("priority_fifo"), 1);
}
BOOST_FIXTURE_TEST_CASE(EvictOne, CsFixture)
{
- cs.setPolicy(make_unique<PriorityFifoPolicy>());
+ cs.setPolicy(make_unique<cs::PriorityFifoPolicy>());
cs.setLimit(3);
insert(1, "/A", [] (Data& data) { data.setFreshnessPeriod(99999_ms); });
@@ -71,7 +69,7 @@
BOOST_FIXTURE_TEST_CASE(Refresh, CsFixture)
{
- cs.setPolicy(make_unique<PriorityFifoPolicy>());
+ cs.setPolicy(make_unique<cs::PriorityFifoPolicy>());
cs.setLimit(3);
insert(1, "/A", [] (Data& data) { data.setFreshnessPeriod(99999_ms); });
@@ -99,6 +97,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestCsPriorityFifo
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/cs.t.cpp b/tests/daemon/table/cs.t.cpp
index b8e34de..67a5621 100644
--- a/tests/daemon/table/cs.t.cpp
+++ b/tests/daemon/table/cs.t.cpp
@@ -29,9 +29,7 @@
#include <ndn-cxx/lp/tags.hpp>
-namespace nfd {
-namespace cs {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Table)
BOOST_FIXTURE_TEST_SUITE(TestCs, CsFixture)
@@ -275,6 +273,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestCs
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/dead-nonce-list.t.cpp b/tests/daemon/table/dead-nonce-list.t.cpp
index 44b0bfd..7df4ec8 100644
--- a/tests/daemon/table/dead-nonce-list.t.cpp
+++ b/tests/daemon/table/dead-nonce-list.t.cpp
@@ -29,8 +29,7 @@
#include "tests/test-common.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Table)
BOOST_FIXTURE_TEST_SUITE(TestDeadNonceList, GlobalIoFixture)
@@ -193,5 +192,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestDeadNonceList
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/fib.t.cpp b/tests/daemon/table/fib.t.cpp
index 1655fac..e0246db 100644
--- a/tests/daemon/table/fib.t.cpp
+++ b/tests/daemon/table/fib.t.cpp
@@ -31,11 +31,9 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/face/dummy-face.hpp"
-namespace nfd {
-namespace fib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::fib;
BOOST_AUTO_TEST_SUITE(Table)
BOOST_FIXTURE_TEST_SUITE(TestFib, GlobalIoFixture)
@@ -390,6 +388,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFib
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace fib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/measurements-accessor.t.cpp b/tests/daemon/table/measurements-accessor.t.cpp
index 67e0623..73ec418 100644
--- a/tests/daemon/table/measurements-accessor.t.cpp
+++ b/tests/daemon/table/measurements-accessor.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, 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,
@@ -31,11 +31,7 @@
#include "tests/daemon/fw/dummy-strategy.hpp"
#include "tests/daemon/fw/choose-strategy.hpp"
-namespace nfd {
-namespace measurements {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
class MeasurementsAccessorTestStrategy : public DummyStrategy
{
@@ -114,13 +110,13 @@
BOOST_AUTO_TEST_CASE(GetParent)
{
- Entry& entryRoot = measurements.get("/");
+ auto& entryRoot = measurements.get("/");
BOOST_CHECK(accessor1->getParent(entryRoot) == nullptr);
BOOST_CHECK(accessor2->getParent(entryRoot) == nullptr);
- Entry& entryA = measurements.get("/A");
+ auto& entryA = measurements.get("/A");
BOOST_CHECK(accessor2->getParent(entryA) == nullptr);
- Entry& entryAD = measurements.get("/A/D");
+ auto& entryAD = measurements.get("/A/D");
BOOST_CHECK(accessor2->getParent(entryAD) != nullptr);
// whether accessor1 and accessor3 can getParent(entryA) and getParent(entryAD) is undefined,
// because they shouldn't have obtained those entries in the first place
@@ -176,6 +172,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestMeasurementsAccessor
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace measurements
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/measurements.t.cpp b/tests/daemon/table/measurements.t.cpp
index 23034a3..9ba03d8 100644
--- a/tests/daemon/table/measurements.t.cpp
+++ b/tests/daemon/table/measurements.t.cpp
@@ -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,
@@ -30,11 +30,9 @@
#include "tests/test-common.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace measurements {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::measurements;
BOOST_AUTO_TEST_SUITE(Table)
@@ -260,6 +258,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestMeasurements
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace measurements
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/name-tree.t.cpp b/tests/daemon/table/name-tree.t.cpp
index 6c410aa..8a7665e 100644
--- a/tests/daemon/table/name-tree.t.cpp
+++ b/tests/daemon/table/name-tree.t.cpp
@@ -30,11 +30,9 @@
#include <unordered_set>
-namespace nfd {
-namespace name_tree {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::name_tree;
BOOST_AUTO_TEST_SUITE(Table)
BOOST_FIXTURE_TEST_SUITE(TestNameTree, GlobalIoFixture)
@@ -764,6 +762,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestNameTree
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/network-region-table.t.cpp b/tests/daemon/table/network-region-table.t.cpp
index 431e3d3..e3c568f 100644
--- a/tests/daemon/table/network-region-table.t.cpp
+++ b/tests/daemon/table/network-region-table.t.cpp
@@ -28,8 +28,7 @@
#include "tests/test-common.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Table)
BOOST_FIXTURE_TEST_SUITE(TestNetworkRegionTable, GlobalIoFixture)
@@ -59,5 +58,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestNetworkRegionTable
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/pit-entry.t.cpp b/tests/daemon/table/pit-entry.t.cpp
index 6f97a1c..45076e3 100644
--- a/tests/daemon/table/pit-entry.t.cpp
+++ b/tests/daemon/table/pit-entry.t.cpp
@@ -33,11 +33,9 @@
namespace bdata = boost::unit_test::data;
-namespace nfd {
-namespace pit {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::pit;
BOOST_AUTO_TEST_SUITE(Table)
BOOST_FIXTURE_TEST_SUITE(TestPitEntry, GlobalIoFixture)
@@ -239,6 +237,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestPitEntry
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/pit.t.cpp b/tests/daemon/table/pit.t.cpp
index defa768..b52ac0e 100644
--- a/tests/daemon/table/pit.t.cpp
+++ b/tests/daemon/table/pit.t.cpp
@@ -27,13 +27,10 @@
#include "tests/test-common.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
-namespace nfd {
-namespace pit {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::pit;
BOOST_AUTO_TEST_SUITE(Table)
BOOST_FIXTURE_TEST_SUITE(TestPit, GlobalIoFixture)
@@ -344,6 +341,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestPit
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/strategy-choice.t.cpp b/tests/daemon/table/strategy-choice.t.cpp
index ff6b754..574317d 100644
--- a/tests/daemon/table/strategy-choice.t.cpp
+++ b/tests/daemon/table/strategy-choice.t.cpp
@@ -29,8 +29,7 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/fw/dummy-strategy.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class StrategyChoiceFixture : public GlobalIoFixture
{
@@ -335,5 +334,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyChoice
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/strategy-info-host.t.cpp b/tests/daemon/table/strategy-info-host.t.cpp
index e4323e4..87c36c8 100644
--- a/tests/daemon/table/strategy-info-host.t.cpp
+++ b/tests/daemon/table/strategy-info-host.t.cpp
@@ -28,8 +28,7 @@
#include "tests/test-common.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
using fw::StrategyInfo;
@@ -131,5 +130,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyInfoHost
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests