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/security/tpm/back-end-wrapper-file.hpp b/tests/unit/security/tpm/back-end-wrapper-file.hpp
index 2da77aa..6d8a663 100644
--- a/tests/unit/security/tpm/back-end-wrapper-file.hpp
+++ b/tests/unit/security/tpm/back-end-wrapper-file.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2021 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).
  *
@@ -26,10 +26,7 @@
 
 #include <boost/filesystem.hpp>
 
-namespace ndn {
-namespace security {
-namespace tpm {
-namespace tests {
+namespace ndn::tests {
 
 /**
  * @brief A wrapper of tpm::BackEndFile for unit test template.
@@ -39,7 +36,7 @@
 public:
   BackEndWrapperFile()
     : m_tmpPath(boost::filesystem::path(UNIT_TESTS_TMPDIR) / "TpmBackEndFile")
-    , m_impl(make_unique<BackEndFile>(m_tmpPath.string()))
+    , m_impl(make_unique<security::tpm::BackEndFile>(m_tmpPath.string()))
   {
   }
 
@@ -48,7 +45,7 @@
     boost::filesystem::remove_all(m_tmpPath);
   }
 
-  BackEnd&
+  security::tpm::BackEnd&
   getTpm()
   {
     return *m_impl;
@@ -62,12 +59,9 @@
 
 private:
   const boost::filesystem::path m_tmpPath;
-  const unique_ptr<BackEnd> m_impl;
+  const unique_ptr<security::tpm::BackEnd> m_impl;
 };
 
-} // namespace tests
-} // namespace tpm
-} // namespace security
-} // namespace ndn
+} // namespace ndn::tests
 
 #endif // NDN_CXX_TESTS_UNIT_SECURITY_TPM_BACK_END_WRAPPER_FILE_HPP
diff --git a/tests/unit/security/tpm/back-end-wrapper-mem.hpp b/tests/unit/security/tpm/back-end-wrapper-mem.hpp
index 8de2b12..20dae82 100644
--- a/tests/unit/security/tpm/back-end-wrapper-mem.hpp
+++ b/tests/unit/security/tpm/back-end-wrapper-mem.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2021 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,10 +24,7 @@
 
 #include "ndn-cxx/security/tpm/impl/back-end-mem.hpp"
 
-namespace ndn {
-namespace security {
-namespace tpm {
-namespace tests {
+namespace ndn::tests {
 
 /**
  * @brief A wrapper of tpm::BackEndMem for unit test template.
@@ -36,11 +33,11 @@
 {
 public:
   BackEndWrapperMem()
-    : m_impl(make_unique<BackEndMem>())
+    : m_impl(make_unique<security::tpm::BackEndMem>())
   {
   }
 
-  BackEnd&
+  security::tpm::BackEnd&
   getTpm()
   {
     return *m_impl;
@@ -53,12 +50,9 @@
   }
 
 private:
-  const unique_ptr<BackEnd> m_impl;
+  const unique_ptr<security::tpm::BackEnd> m_impl;
 };
 
-} // namespace tests
-} // namespace tpm
-} // namespace security
-} // namespace ndn
+} // namespace ndn::tests
 
 #endif // NDN_CXX_TESTS_UNIT_SECURITY_TPM_BACK_END_WRAPPER_MEM_HPP
diff --git a/tests/unit/security/tpm/back-end-wrapper-osx.hpp b/tests/unit/security/tpm/back-end-wrapper-osx.hpp
index c459c47..542c319 100644
--- a/tests/unit/security/tpm/back-end-wrapper-osx.hpp
+++ b/tests/unit/security/tpm/back-end-wrapper-osx.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2021 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).
  *
@@ -27,10 +27,7 @@
 
 #include <cstdlib>
 
-namespace ndn {
-namespace security {
-namespace tpm {
-namespace tests {
+namespace ndn::tests {
 
 /**
  * @brief A wrapper of tpm::BackEndOsx for unit test template.
@@ -52,7 +49,7 @@
     else
       unsetenv("HOME");
 
-    m_impl = make_unique<BackEndOsx>();
+    m_impl = make_unique<security::tpm::BackEndOsx>();
   }
 
   ~BackEndWrapperOsx()
@@ -63,7 +60,7 @@
       unsetenv("HOME");
   }
 
-  BackEnd&
+  security::tpm::BackEnd&
   getTpm()
   {
     return *m_impl;
@@ -77,12 +74,9 @@
 
 private:
   std::string m_HOME;
-  unique_ptr<BackEnd> m_impl;
+  unique_ptr<security::tpm::BackEnd> m_impl;
 };
 
-} // namespace tests
-} // namespace tpm
-} // namespace security
-} // namespace ndn
+} // namespace ndn::tests
 
 #endif // NDN_CXX_TESTS_UNIT_SECURITY_TPM_BACK_END_WRAPPER_OSX_HPP
diff --git a/tests/unit/security/tpm/back-end.t.cpp b/tests/unit/security/tpm/back-end.t.cpp
index 78f09e3..34d79b4 100644
--- a/tests/unit/security/tpm/back-end.t.cpp
+++ b/tests/unit/security/tpm/back-end.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).
  *
@@ -41,16 +41,14 @@
 #include <boost/mpl/vector.hpp>
 #include <set>
 
-namespace ndn {
-namespace security {
-namespace tpm {
-namespace tests {
+namespace ndn::tests {
+
+using namespace ndn::security;
+using ndn::security::tpm::BackEnd;
+using ndn::security::tpm::KeyHandle;
 
 BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(Tpm)
-BOOST_AUTO_TEST_SUITE(TestBackEnd)
-
-using tpm::Tpm;
+BOOST_AUTO_TEST_SUITE(TestTpmBackEnd)
 
 using TestBackEnds = boost::mpl::vector<
 #if defined(NDN_CXX_HAVE_OSX_FRAMEWORKS) && defined(NDN_CXX_WITH_OSX_KEYCHAIN)
@@ -354,11 +352,7 @@
   }
 }
 
-BOOST_AUTO_TEST_SUITE_END() // TestBackEnd
-BOOST_AUTO_TEST_SUITE_END() // Tpm
+BOOST_AUTO_TEST_SUITE_END() // TestTpmBackEnd
 BOOST_AUTO_TEST_SUITE_END() // Security
 
-} // namespace tests
-} // namespace tpm
-} // namespace security
-} // namespace ndn
+} // namespace ndn::tests