Refactor and modernize namespace declarations

 * Completely remove inline namespace v2
 * Flatten some unnecessarily deep namespace nesting
 * Move DummyClientFace, Segmenter, SegmentFetcher to namespace ndn
 * Move all unit tests to namespace ndn::tests

Change-Id: I8bcfcf9fd669936a3277d2d5d505f765b4b05742
diff --git a/tests/unit/mgmt/control-response.t.cpp b/tests/unit/mgmt/control-response.t.cpp
index 1dd69b1..7e72c26 100644
--- a/tests/unit/mgmt/control-response.t.cpp
+++ b/tests/unit/mgmt/control-response.t.cpp
@@ -24,9 +24,9 @@
 
 #include "tests/boost-test.hpp"
 
-namespace ndn {
-namespace mgmt {
-namespace tests {
+namespace ndn::tests {
+
+using namespace ndn::mgmt;
 
 BOOST_CONCEPT_ASSERT((WireEncodable<ControlResponse>));
 BOOST_CONCEPT_ASSERT((WireDecodable<ControlResponse>));
@@ -62,6 +62,4 @@
 BOOST_AUTO_TEST_SUITE_END() // TestControlResponse
 BOOST_AUTO_TEST_SUITE_END() // Mgmt
 
-} // namespace tests
-} // namespace mgmt
-} // namespace ndn
+} // namespace ndn::tests
diff --git a/tests/unit/mgmt/dispatcher.t.cpp b/tests/unit/mgmt/dispatcher.t.cpp
index 9b01628..1e1c947 100644
--- a/tests/unit/mgmt/dispatcher.t.cpp
+++ b/tests/unit/mgmt/dispatcher.t.cpp
@@ -26,11 +26,9 @@
 #include "tests/test-common.hpp"
 #include "tests/unit/io-key-chain-fixture.hpp"
 
-namespace ndn {
-namespace mgmt {
-namespace tests {
+namespace ndn::tests {
 
-using namespace ndn::tests;
+using namespace ndn::mgmt;
 
 class DispatcherFixture : public IoKeyChainFixture
 {
@@ -43,7 +41,7 @@
   }
 
 public:
-  util::DummyClientFace face;
+  DummyClientFace face;
   mgmt::Dispatcher dispatcher;
   InMemoryStorageFifo& storage;
 };
@@ -473,6 +471,4 @@
 BOOST_AUTO_TEST_SUITE_END() // TestDispatcher
 BOOST_AUTO_TEST_SUITE_END() // Mgmt
 
-} // namespace tests
-} // namespace mgmt
-} // namespace ndn
+} // namespace ndn::tests
diff --git a/tests/unit/mgmt/nfd/channel-status.t.cpp b/tests/unit/mgmt/nfd/channel-status.t.cpp
index 8036d0d..b9c6455 100644
--- a/tests/unit/mgmt/nfd/channel-status.t.cpp
+++ b/tests/unit/mgmt/nfd/channel-status.t.cpp
@@ -26,9 +26,9 @@
 
 #include <boost/lexical_cast.hpp>
 
-namespace ndn {
-namespace nfd {
-namespace tests {
+namespace ndn::tests {
+
+using namespace ndn::nfd;
 
 BOOST_CONCEPT_ASSERT((StatusDatasetItem<ChannelStatus>));
 
@@ -85,6 +85,4 @@
 BOOST_AUTO_TEST_SUITE_END() // Nfd
 BOOST_AUTO_TEST_SUITE_END() // Mgmt
 
-} // namespace tests
-} // namespace nfd
-} // namespace ndn
+} // namespace ndn::tests
diff --git a/tests/unit/mgmt/nfd/command-options.t.cpp b/tests/unit/mgmt/nfd/command-options.t.cpp
index d41c512..f7d74b1 100644
--- a/tests/unit/mgmt/nfd/command-options.t.cpp
+++ b/tests/unit/mgmt/nfd/command-options.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -24,9 +24,9 @@
 
 #include "tests/boost-test.hpp"
 
-namespace ndn {
-namespace nfd {
-namespace tests {
+namespace ndn::tests {
+
+using namespace ndn::nfd;
 
 BOOST_AUTO_TEST_SUITE(Mgmt)
 BOOST_AUTO_TEST_SUITE(Nfd)
@@ -74,6 +74,4 @@
 BOOST_AUTO_TEST_SUITE_END() // Nfd
 BOOST_AUTO_TEST_SUITE_END() // Mgmt
 
-} // namespace tests
-} // namespace nfd
-} // namespace ndn
+} // namespace ndn::tests
diff --git a/tests/unit/mgmt/nfd/control-command.t.cpp b/tests/unit/mgmt/nfd/control-command.t.cpp
index 25371fd..2da5270 100644
--- a/tests/unit/mgmt/nfd/control-command.t.cpp
+++ b/tests/unit/mgmt/nfd/control-command.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2020 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -23,9 +23,9 @@
 
 #include "tests/boost-test.hpp"
 
-namespace ndn {
-namespace nfd {
-namespace tests {
+namespace ndn::tests {
+
+using namespace ndn::nfd;
 
 BOOST_AUTO_TEST_SUITE(Mgmt)
 BOOST_AUTO_TEST_SUITE(Nfd)
@@ -500,6 +500,4 @@
 BOOST_AUTO_TEST_SUITE_END() // Nfd
 BOOST_AUTO_TEST_SUITE_END() // Mgmt
 
-} // namespace tests
-} // namespace nfd
-} // namespace ndn
+} // namespace ndn::tests
diff --git a/tests/unit/mgmt/nfd/control-parameters.t.cpp b/tests/unit/mgmt/nfd/control-parameters.t.cpp
index 4866620..e89b4f3 100644
--- a/tests/unit/mgmt/nfd/control-parameters.t.cpp
+++ b/tests/unit/mgmt/nfd/control-parameters.t.cpp
@@ -24,9 +24,9 @@
 
 #include "tests/boost-test.hpp"
 
-namespace ndn {
-namespace nfd {
-namespace tests {
+namespace ndn::tests {
+
+using namespace ndn::nfd;
 
 BOOST_CONCEPT_ASSERT((WireEncodable<ControlParameters>));
 BOOST_CONCEPT_ASSERT((WireDecodable<ControlParameters>));
@@ -248,6 +248,4 @@
 BOOST_AUTO_TEST_SUITE_END() // Nfd
 BOOST_AUTO_TEST_SUITE_END() // Mgmt
 
-} // namespace tests
-} // namespace nfd
-} // namespace ndn
+} // namespace ndn::tests
diff --git a/tests/unit/mgmt/nfd/controller-fixture.hpp b/tests/unit/mgmt/nfd/controller-fixture.hpp
index 38b44fd..d1cd401 100644
--- a/tests/unit/mgmt/nfd/controller-fixture.hpp
+++ b/tests/unit/mgmt/nfd/controller-fixture.hpp
@@ -28,11 +28,7 @@
 #include "tests/unit/dummy-validator.hpp"
 #include "tests/unit/io-key-chain-fixture.hpp"
 
-namespace ndn {
-namespace nfd {
-namespace tests {
-
-using namespace ndn::tests;
+namespace ndn::tests {
 
 class ControllerFixture : public IoKeyChainFixture
 {
@@ -59,16 +55,14 @@
   }
 
 protected:
-  ndn::util::DummyClientFace face;
+  DummyClientFace face;
   DummyValidator m_validator;
-  Controller controller;
-  CommandFailureCallback commandFailCallback;
-  DatasetFailureCallback datasetFailCallback;
+  nfd::Controller controller;
+  nfd::CommandFailureCallback commandFailCallback;
+  nfd::DatasetFailureCallback datasetFailCallback;
   std::vector<uint32_t> failCodes;
 };
 
-} // namespace tests
-} // namespace nfd
-} // namespace ndn
+} // namespace ndn::tests
 
 #endif // NDN_CXX_TESTS_UNIT_MGMT_NFD_CONTROLLER_FIXTURE_HPP
diff --git a/tests/unit/mgmt/nfd/controller.t.cpp b/tests/unit/mgmt/nfd/controller.t.cpp
index d68611f..6760d5e 100644
--- a/tests/unit/mgmt/nfd/controller.t.cpp
+++ b/tests/unit/mgmt/nfd/controller.t.cpp
@@ -25,11 +25,9 @@
 #include "tests/test-common.hpp"
 #include "tests/unit/mgmt/nfd/controller-fixture.hpp"
 
-namespace ndn {
-namespace nfd {
-namespace tests {
+namespace ndn::tests {
 
-using namespace ndn::tests;
+using namespace ndn::nfd;
 
 BOOST_AUTO_TEST_SUITE(Mgmt)
 BOOST_AUTO_TEST_SUITE(Nfd)
@@ -260,6 +258,4 @@
 BOOST_AUTO_TEST_SUITE_END() // Nfd
 BOOST_AUTO_TEST_SUITE_END() // Mgmt
 
-} // namespace tests
-} // namespace nfd
-} // namespace ndn
+} // namespace ndn::tests
diff --git a/tests/unit/mgmt/nfd/cs-info.t.cpp b/tests/unit/mgmt/nfd/cs-info.t.cpp
index 70d8a20..9e4a437 100644
--- a/tests/unit/mgmt/nfd/cs-info.t.cpp
+++ b/tests/unit/mgmt/nfd/cs-info.t.cpp
@@ -26,9 +26,9 @@
 
 #include <boost/lexical_cast.hpp>
 
-namespace ndn {
-namespace nfd {
-namespace tests {
+namespace ndn::tests {
+
+using namespace ndn::nfd;
 
 BOOST_CONCEPT_ASSERT((StatusDatasetItem<CsInfo>));
 
@@ -126,6 +126,4 @@
 BOOST_AUTO_TEST_SUITE_END() // Nfd
 BOOST_AUTO_TEST_SUITE_END() // Mgmt
 
-} // namespace tests
-} // namespace nfd
-} // namespace ndn
+} // namespace ndn::tests
diff --git a/tests/unit/mgmt/nfd/face-event-notification.t.cpp b/tests/unit/mgmt/nfd/face-event-notification.t.cpp
index 97b3000..3686b17 100644
--- a/tests/unit/mgmt/nfd/face-event-notification.t.cpp
+++ b/tests/unit/mgmt/nfd/face-event-notification.t.cpp
@@ -26,9 +26,9 @@
 
 #include <boost/lexical_cast.hpp>
 
-namespace ndn {
-namespace nfd {
-namespace tests {
+namespace ndn::tests {
+
+using namespace ndn::nfd;
 
 BOOST_CONCEPT_ASSERT((NotificationStreamItem<FaceEventNotification>));
 
@@ -268,6 +268,4 @@
 BOOST_AUTO_TEST_SUITE_END() // Nfd
 BOOST_AUTO_TEST_SUITE_END() // Mgmt
 
-} // namespace tests
-} // namespace nfd
-} // namespace ndn
+} // namespace ndn::tests
diff --git a/tests/unit/mgmt/nfd/face-query-filter.t.cpp b/tests/unit/mgmt/nfd/face-query-filter.t.cpp
index 1f83f82..1234259 100644
--- a/tests/unit/mgmt/nfd/face-query-filter.t.cpp
+++ b/tests/unit/mgmt/nfd/face-query-filter.t.cpp
@@ -26,9 +26,9 @@
 
 #include <boost/lexical_cast.hpp>
 
-namespace ndn {
-namespace nfd {
-namespace tests {
+namespace ndn::tests {
+
+using namespace ndn::nfd;
 
 BOOST_CONCEPT_ASSERT((boost::EqualityComparable<FaceQueryFilter>));
 BOOST_CONCEPT_ASSERT((WireEncodable<FaceQueryFilter>));
@@ -146,6 +146,4 @@
 BOOST_AUTO_TEST_SUITE_END() // Nfd
 BOOST_AUTO_TEST_SUITE_END() // Mgmt
 
-} // namespace tests
-} // namespace nfd
-} // namespace ndn
+} // namespace ndn::tests
diff --git a/tests/unit/mgmt/nfd/face-status.t.cpp b/tests/unit/mgmt/nfd/face-status.t.cpp
index 275acf2..24be329 100644
--- a/tests/unit/mgmt/nfd/face-status.t.cpp
+++ b/tests/unit/mgmt/nfd/face-status.t.cpp
@@ -26,9 +26,9 @@
 
 #include <boost/lexical_cast.hpp>
 
-namespace ndn {
-namespace nfd {
-namespace tests {
+namespace ndn::tests {
+
+using namespace ndn::nfd;
 
 BOOST_CONCEPT_ASSERT((StatusDatasetItem<FaceStatus>));
 
@@ -178,6 +178,4 @@
 BOOST_AUTO_TEST_SUITE_END() // Nfd
 BOOST_AUTO_TEST_SUITE_END() // Mgmt
 
-} // namespace tests
-} // namespace nfd
-} // namespace ndn
+} // namespace ndn::tests
diff --git a/tests/unit/mgmt/nfd/fib-entry.t.cpp b/tests/unit/mgmt/nfd/fib-entry.t.cpp
index 81f94e5..d802250 100644
--- a/tests/unit/mgmt/nfd/fib-entry.t.cpp
+++ b/tests/unit/mgmt/nfd/fib-entry.t.cpp
@@ -26,9 +26,9 @@
 
 #include <boost/lexical_cast.hpp>
 
-namespace ndn {
-namespace nfd {
-namespace tests {
+namespace ndn::tests {
+
+using namespace ndn::nfd;
 
 BOOST_CONCEPT_ASSERT((StatusDatasetItem<NextHopRecord>));
 BOOST_CONCEPT_ASSERT((StatusDatasetItem<FibEntry>));
@@ -212,6 +212,4 @@
 BOOST_AUTO_TEST_SUITE_END() // Nfd
 BOOST_AUTO_TEST_SUITE_END() // Mgmt
 
-} // namespace tests
-} // namespace nfd
-} // namespace ndn
+} // namespace ndn::tests
diff --git a/tests/unit/mgmt/nfd/forwarder-status.t.cpp b/tests/unit/mgmt/nfd/forwarder-status.t.cpp
index 6492e55..056917d 100644
--- a/tests/unit/mgmt/nfd/forwarder-status.t.cpp
+++ b/tests/unit/mgmt/nfd/forwarder-status.t.cpp
@@ -26,9 +26,9 @@
 
 #include <boost/lexical_cast.hpp>
 
-namespace ndn {
-namespace nfd {
-namespace tests {
+namespace ndn::tests {
+
+using namespace ndn::nfd;
 
 BOOST_CONCEPT_ASSERT((StatusDatasetItem<ForwarderStatus>));
 
@@ -140,6 +140,4 @@
 BOOST_AUTO_TEST_SUITE_END() // Nfd
 BOOST_AUTO_TEST_SUITE_END() // Mgmt
 
-} // namespace tests
-} // namespace nfd
-} // namespace ndn
+} // namespace ndn::tests
diff --git a/tests/unit/mgmt/nfd/rib-entry.t.cpp b/tests/unit/mgmt/nfd/rib-entry.t.cpp
index 3479c01..ae924bf 100644
--- a/tests/unit/mgmt/nfd/rib-entry.t.cpp
+++ b/tests/unit/mgmt/nfd/rib-entry.t.cpp
@@ -26,9 +26,9 @@
 
 #include <boost/lexical_cast.hpp>
 
-namespace ndn {
-namespace nfd {
-namespace tests {
+namespace ndn::tests {
+
+using namespace ndn::nfd;
 
 BOOST_CONCEPT_ASSERT((StatusDatasetItem<Route>));
 BOOST_CONCEPT_ASSERT((StatusDatasetItem<RibEntry>));
@@ -240,6 +240,4 @@
 BOOST_AUTO_TEST_SUITE_END() // Nfd
 BOOST_AUTO_TEST_SUITE_END() // Mgmt
 
-} // namespace tests
-} // namespace nfd
-} // namespace ndn
+} // namespace ndn::tests
diff --git a/tests/unit/mgmt/nfd/status-dataset.t.cpp b/tests/unit/mgmt/nfd/status-dataset.t.cpp
index 511498d..bb6acad 100644
--- a/tests/unit/mgmt/nfd/status-dataset.t.cpp
+++ b/tests/unit/mgmt/nfd/status-dataset.t.cpp
@@ -25,11 +25,9 @@
 #include "tests/test-common.hpp"
 #include "tests/unit/mgmt/nfd/controller-fixture.hpp"
 
-namespace ndn {
-namespace nfd {
-namespace tests {
+namespace ndn::tests {
 
-using namespace ndn::tests;
+using namespace ndn::nfd;
 
 BOOST_AUTO_TEST_SUITE(Mgmt)
 BOOST_AUTO_TEST_SUITE(Nfd)
@@ -479,6 +477,4 @@
 BOOST_AUTO_TEST_SUITE_END() // Nfd
 BOOST_AUTO_TEST_SUITE_END() // Mgmt
 
-} // namespace tests
-} // namespace nfd
-} // namespace ndn
+} // namespace ndn::tests
diff --git a/tests/unit/mgmt/nfd/strategy-choice.t.cpp b/tests/unit/mgmt/nfd/strategy-choice.t.cpp
index 92f271c..63d644b 100644
--- a/tests/unit/mgmt/nfd/strategy-choice.t.cpp
+++ b/tests/unit/mgmt/nfd/strategy-choice.t.cpp
@@ -26,9 +26,9 @@
 
 #include <boost/lexical_cast.hpp>
 
-namespace ndn {
-namespace nfd {
-namespace tests {
+namespace ndn::tests {
+
+using namespace ndn::nfd;
 
 BOOST_CONCEPT_ASSERT((StatusDatasetItem<StrategyChoice>));
 
@@ -95,6 +95,4 @@
 BOOST_AUTO_TEST_SUITE_END() // Nfd
 BOOST_AUTO_TEST_SUITE_END() // Mgmt
 
-} // namespace tests
-} // namespace nfd
-} // namespace ndn
+} // namespace ndn::tests
diff --git a/tests/unit/mgmt/status-dataset-context.t.cpp b/tests/unit/mgmt/status-dataset-context.t.cpp
index 69b2694..f219729 100644
--- a/tests/unit/mgmt/status-dataset-context.t.cpp
+++ b/tests/unit/mgmt/status-dataset-context.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2022 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -23,11 +23,9 @@
 
 #include "tests/test-common.hpp"
 
-namespace ndn {
-namespace mgmt {
-namespace tests {
+namespace ndn::tests {
 
-using namespace ndn::tests;
+using namespace ndn::mgmt;
 
 class StatusDatasetContextFixture
 {
@@ -301,6 +299,4 @@
 BOOST_AUTO_TEST_SUITE_END() // TestStatusDatasetContext
 BOOST_AUTO_TEST_SUITE_END() // Mgmt
 
-} // namespace tests
-} // namespace mgmt
-} // namespace ndn
+} // namespace ndn::tests