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