Skip to content

Commit

Permalink
tests: namespace cleanup
Browse files Browse the repository at this point in the history
Change-Id: I6b9ee82a4cb3b97c82ea111495ec07efddc8d825
  • Loading branch information
Pesa committed Feb 13, 2024
1 parent d6922b5 commit 288141a
Show file tree
Hide file tree
Showing 43 changed files with 182 additions and 309 deletions.
8 changes: 3 additions & 5 deletions tests/clock-fixture.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Regents of the University of California,
* Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
Expand All @@ -25,8 +25,7 @@

#include "tests/clock-fixture.hpp"

namespace nlsr {
namespace test {
namespace nlsr::tests {

ClockFixture::ClockFixture()
: m_steadyClock(std::make_shared<time::UnitTestSteadyClock>())
Expand Down Expand Up @@ -56,5 +55,4 @@ ClockFixture::advanceClocks(time::nanoseconds tick, time::nanoseconds total)
}
}

} // namespace test
} // namespace nlsr
} // namespace nlsr::tests
6 changes: 3 additions & 3 deletions tests/clock-fixture.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Regents of the University of California,
* Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
Expand Down Expand Up @@ -28,7 +28,7 @@

#include <ndn-cxx/util/time-unit-test-clock.hpp>

namespace nlsr::test {
namespace nlsr::tests {

namespace time = ndn::time;

Expand Down Expand Up @@ -84,6 +84,6 @@ class ClockFixture
std::shared_ptr<time::UnitTestSystemClock> m_systemClock;
};

} // namespace nlsr::test
} // namespace nlsr::tests

#endif // NLSR_TESTS_CLOCK_FIXTURE_HPP
10 changes: 5 additions & 5 deletions tests/communication/test-sync-logic-handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "tests/io-key-chain-fixture.hpp"
#include "tests/test-common.hpp"

namespace nlsr::test {
namespace nlsr::tests {

class SyncLogicFixture : public IoKeyChainFixture
{
Expand All @@ -47,14 +47,14 @@ class SyncLogicFixture : public IoKeyChainFixture
void
receiveUpdate(const ndn::Name& prefix, uint64_t seqNo)
{
this->advanceClocks(ndn::time::milliseconds(1), 10);
this->advanceClocks(1_ms, 10);
face.sentInterests.clear();

std::vector<psync::MissingDataInfo> updates;
updates.push_back({prefix, 0, seqNo, 0});
getSync().m_syncLogic.onPSyncUpdate(updates);

this->advanceClocks(ndn::time::milliseconds(1), 10);
this->advanceClocks(1_ms, 10);
}

public:
Expand All @@ -64,7 +64,7 @@ class SyncLogicFixture : public IoKeyChainFixture
SyncProtocol::PSYNC,
ndn::Name("/ndn/nlsr/sync").appendVersion(ConfParameter::SYNC_VERSION),
"/localhop/ndn/nlsr/LSA/site/%C1.Router/this-router",
ndn::time::milliseconds(SYNC_INTEREST_LIFETIME_DEFAULT),
time::milliseconds(SYNC_INTEREST_LIFETIME_DEFAULT),
"/ndn/site/%C1.Router/this-router",
HYPERBOLIC_STATE_OFF
};
Expand Down Expand Up @@ -245,4 +245,4 @@ BOOST_AUTO_TEST_CASE(UpdatePrefix)

BOOST_AUTO_TEST_SUITE_END()

} // namespace nlsr::test
} // namespace nlsr::tests
10 changes: 4 additions & 6 deletions tests/communication/test-sync-protocol-adapter.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2023, The University of Memphis,
* Copyright (c) 2014-2024, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand All @@ -26,8 +26,7 @@

#include <ndn-cxx/util/dummy-client-face.hpp>

namespace nlsr {
namespace test {
namespace nlsr::tests {

using ndn::Name;

Expand Down Expand Up @@ -64,7 +63,7 @@ class SyncProtocolAdapterFixture : public IoKeyChainFixture
Name syncPrefix;
Name nameLsaUserPrefix;
Name userPrefixes[2];
ndn::time::milliseconds syncInterestLifetime;
time::milliseconds syncInterestLifetime;
std::shared_ptr<ndn::DummyClientFace> faces[2];
std::shared_ptr<SyncProtocolAdapter> nodes[2];
std::map<Name, uint64_t> prefixToSeq[2];
Expand Down Expand Up @@ -106,5 +105,4 @@ BOOST_FIXTURE_TEST_CASE(Basic, SyncProtocolAdapterFixture)

BOOST_AUTO_TEST_SUITE_END()

} // namespace test
} // namespace nlsr
} // namespace nlsr::tests
6 changes: 3 additions & 3 deletions tests/io-fixture.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2023, Regents of the University of California,
* Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
Expand Down Expand Up @@ -30,7 +30,7 @@

#include <boost/asio/io_context.hpp>

namespace nlsr::test {
namespace nlsr::tests {

class IoFixture : public ClockFixture
{
Expand All @@ -48,6 +48,6 @@ class IoFixture : public ClockFixture
boost::asio::io_context m_io;
};

} // namespace nlsr::test
} // namespace nlsr::tests

#endif // NLSR_TESTS_IO_FIXTURE_HPP
6 changes: 3 additions & 3 deletions tests/io-key-chain-fixture.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, The University of Memphis,
* Copyright (c) 2014-2024, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand All @@ -25,12 +25,12 @@
#include "tests/key-chain-fixture.hpp"
#include "tests/io-fixture.hpp"

namespace nlsr::test {
namespace nlsr::tests {

class IoKeyChainFixture : public IoFixture, public KeyChainFixture
{
};

} // namespace nlsr::test
} // namespace nlsr::tests

#endif // NLSR_TESTS_IO_KEY_CHAIN_FIXTURE_HPP
10 changes: 4 additions & 6 deletions tests/key-chain-fixture.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Regents of the University of California,
* Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
Expand Down Expand Up @@ -29,8 +29,7 @@

#include <boost/filesystem/operations.hpp>

namespace nlsr {
namespace test {
namespace nlsr::tests {

using namespace ndn::security;

Expand Down Expand Up @@ -104,13 +103,12 @@ KeyChainFixture::addSubCertificate(const ndn::Name& subIdentityName,

auto request = subIdentity.getDefaultKey().getDefaultCertificate();
ndn::security::MakeCertificateOptions opts;
opts.issuerId = ndn::name::Component::fromEscapedString("parent");
opts.issuerId = ndn::name::Component::fromUri("parent");
m_keyChain.makeCertificate(request, ndn::signingByIdentity(issuer), opts);

m_keyChain.setDefaultCertificate(subIdentity.getDefaultKey(), request);

return subIdentity;
}

} // namespace test
} // namespace nlsr
} // namespace nlsr::tests
6 changes: 3 additions & 3 deletions tests/key-chain-fixture.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Regents of the University of California,
* Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
Expand Down Expand Up @@ -29,7 +29,7 @@
#include <ndn-cxx/security/key-chain.hpp>
#include <ndn-cxx/security/signing-helpers.hpp>

namespace nlsr::test {
namespace nlsr::tests {

/**
* @brief A fixture providing an in-memory KeyChain.
Expand Down Expand Up @@ -95,6 +95,6 @@ class KeyChainFixture
std::vector<std::string> m_certFiles;
};

} // namespace nlsr::test
} // namespace nlsr::tests

#endif // NLSR_TESTS_KEY_CHAIN_FIXTURE_HPP
4 changes: 2 additions & 2 deletions tests/lsa/test-adj-lsa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include "tests/boost-test.hpp"

namespace nlsr::test {
namespace nlsr::tests {

BOOST_AUTO_TEST_SUITE(TestAdjLsa)

Expand Down Expand Up @@ -184,4 +184,4 @@ BOOST_AUTO_TEST_CASE(InitializeFromContent)

BOOST_AUTO_TEST_SUITE_END()

} // namespace nlsr::test
} // namespace nlsr::tests
4 changes: 2 additions & 2 deletions tests/lsa/test-coordinate-lsa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include "tests/boost-test.hpp"

namespace nlsr::test {
namespace nlsr::tests {

/*
static void
Expand Down Expand Up @@ -134,4 +134,4 @@ BOOST_AUTO_TEST_CASE(InitializeFromContent)

BOOST_AUTO_TEST_SUITE_END()

} // namespace nlsr::test
} // namespace nlsr::tests
6 changes: 3 additions & 3 deletions tests/lsa/test-name-lsa.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2023, The University of Memphis,
* Copyright (c) 2014-2024, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand All @@ -23,7 +23,7 @@

#include "tests/boost-test.hpp"

namespace nlsr::test {
namespace nlsr::tests {

BOOST_AUTO_TEST_SUITE(TestNameLsa)

Expand Down Expand Up @@ -160,4 +160,4 @@ BOOST_AUTO_TEST_CASE(Update)

BOOST_AUTO_TEST_SUITE_END()

} // namespace nlsr::test
} // namespace nlsr::tests
10 changes: 4 additions & 6 deletions tests/publisher/publisher-fixture.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2023, The University of Memphis,
* Copyright (c) 2014-2024, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand Down Expand Up @@ -28,8 +28,7 @@
#include "tests/io-key-chain-fixture.hpp"
#include "tests/test-common.hpp"

namespace nlsr {
namespace test {
namespace nlsr::tests {

class PublisherFixture : public IoKeyChainFixture
{
Expand Down Expand Up @@ -62,7 +61,7 @@ class PublisherFixture : public IoKeyChainFixture
CoordinateLsa
createCoordinateLsa(const std::string& origin, double radius, std::vector<double> angle)
{
return {origin, 1, ndn::time::system_clock::now(), radius, angle};
return {origin, 1, time::system_clock::now(), radius, angle};
}

void
Expand Down Expand Up @@ -91,7 +90,6 @@ class PublisherFixture : public IoKeyChainFixture
RoutingTable& rt1;
};

} // namespace test
} // namespace nlsr
} // namespace nlsr::tests

#endif // NLSR_TESTS_PUBLISHER_FIXTURE_HPP
8 changes: 3 additions & 5 deletions tests/publisher/test-dataset-interest-handler.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, The University of Memphis,
* Copyright (c) 2014-2024, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand All @@ -24,8 +24,7 @@

#include "tests/publisher/publisher-fixture.hpp"

namespace nlsr {
namespace test {
namespace nlsr::tests {

BOOST_FIXTURE_TEST_SUITE(TestDatasetInterestHandler, PublisherFixture)

Expand Down Expand Up @@ -118,5 +117,4 @@ BOOST_AUTO_TEST_CASE(RouterName)

BOOST_AUTO_TEST_SUITE_END()

} // namespace test
} // namespace nlsr
} // namespace nlsr::tests
Loading

0 comments on commit 288141a

Please sign in to comment.