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/validator-config.t.cpp b/tests/unit/security/validator-config.t.cpp
index 391879d..7cdfa53 100644
--- a/tests/unit/security/validator-config.t.cpp
+++ b/tests/unit/security/validator-config.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).
*
@@ -29,11 +29,7 @@
#include "tests/key-chain-fixture.hpp"
#include "tests/unit/security/validator-config/common.hpp"
-namespace ndn {
-namespace security {
-namespace tests {
-
-using namespace ndn::tests;
+namespace ndn::tests {
BOOST_AUTO_TEST_SUITE(Security)
BOOST_FIXTURE_TEST_SUITE(TestValidatorConfig, KeyChainFixture)
@@ -42,12 +38,12 @@
BOOST_AUTO_TEST_CASE(Construct)
{
- util::DummyClientFace face;
+ DummyClientFace face;
ValidatorConfig v1(face);
BOOST_CHECK_EQUAL(v1.m_policyConfig.m_isConfigured, false);
- ValidatorConfig v2(make_unique<CertificateFetcherOffline>());
+ ValidatorConfig v2(make_unique<security::CertificateFetcherOffline>());
BOOST_CHECK_EQUAL(v2.m_policyConfig.m_isConfigured, false);
}
@@ -56,7 +52,7 @@
public:
ValidatorConfigFixture()
: path(boost::filesystem::path(UNIT_TESTS_TMPDIR) / "security" / "validator-config")
- , validator(make_unique<CertificateFetcherOffline>())
+ , validator(make_unique<security::CertificateFetcherOffline>())
{
boost::filesystem::create_directories(path);
config = R"CONF(
@@ -118,11 +114,11 @@
BOOST_AUTO_TEST_CASE(FromSection)
{
- validator.load(validator_config::tests::makeSection(config), "config-file-from-section");
+ validator.load(makeSection(config), "config-file-from-section");
BOOST_CHECK_EQUAL(validator.m_policyConfig.m_isConfigured, true);
// should reload policy
- validator.load(validator_config::tests::makeSection(config), "config-file-from-section");
+ validator.load(makeSection(config), "config-file-from-section");
BOOST_CHECK_EQUAL(validator.m_policyConfig.m_isConfigured, true);
}
@@ -133,7 +129,7 @@
{
validator.load(configFile);
- InterestSigner signer(m_keyChain);
+ security::InterestSigner signer(m_keyChain);
auto i = signer.makeCommandInterest("/hello/world/CMD", signingWithSha256());
size_t nValidated = 0, nFailed = 0;
@@ -155,7 +151,7 @@
{
validator.load(configFile);
- InterestSigner signer(m_keyChain);
+ security::InterestSigner signer(m_keyChain);
Interest i1("/hello/world");
signer.makeSignedInterest(i1);
size_t nValidated = 0, nFailed = 0;
@@ -179,7 +175,7 @@
{
validator.load(configFile);
- InterestSigner signer(m_keyChain);
+ security::InterestSigner signer(m_keyChain);
auto i1 = signer.makeCommandInterest("/hello/world");
size_t nValidated = 0, nFailed = 0;
@@ -200,6 +196,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestValidatorConfig
BOOST_AUTO_TEST_SUITE_END() // Security
-} // namespace tests
-} // namespace security
-} // namespace ndn
+} // namespace ndn::tests