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/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