tests: namespace cleanup
Change-Id: Ic34a8d5330759db6ff037479dc29dc148095a256
diff --git a/tests/unit-tests/bzip2-helper.t.cpp b/tests/unit-tests/bzip2-helper.t.cpp
index 3b213f8..7494668 100644
--- a/tests/unit-tests/bzip2-helper.t.cpp
+++ b/tests/unit-tests/bzip2-helper.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
- * Copyright (c) 2012-2021 University of California, Los Angeles
+ * Copyright (c) 2012-2024 University of California, Los Angeles
*
* This file is part of ChronoSync, synchronization library for distributed realtime
* applications for NDN.
@@ -21,10 +21,9 @@
#include "tests/boost-test.hpp"
-namespace chronosync {
-namespace test {
+namespace chronosync::tests {
-BOOST_AUTO_TEST_SUITE(TestBzip2Helper)
+BOOST_AUTO_TEST_SUITE(Bzip2HelperTests)
BOOST_AUTO_TEST_CASE(Basic)
{
@@ -46,5 +45,4 @@
BOOST_AUTO_TEST_SUITE_END()
-} // namespace test
-} // namespace chronosync
+} // namespace chronosync::tests
diff --git a/tests/unit-tests/dummy-forwarder.cpp b/tests/unit-tests/dummy-forwarder.cpp
index ca43032..cefc08a 100644
--- a/tests/unit-tests/dummy-forwarder.cpp
+++ b/tests/unit-tests/dummy-forwarder.cpp
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
- * Copyright (c) 2012-2023 University of California, Los Angeles
+ * Copyright (c) 2012-2024 University of California, Los Angeles
*
* This file is part of ChronoSync, synchronization library for distributed realtime
* applications for NDN.
@@ -22,23 +22,24 @@
#include <boost/asio/io_context.hpp>
#include <boost/asio/post.hpp>
-namespace ndn {
-namespace chronosync {
+namespace chronosync::tests {
-DummyForwarder::DummyForwarder(boost::asio::io_context& io, KeyChain& keyChain)
+using ndn::DummyClientFace;
+
+DummyForwarder::DummyForwarder(boost::asio::io_context& io, ndn::KeyChain& keyChain)
: m_io(io)
, m_keyChain(keyChain)
{
}
-Face&
+ndn::Face&
DummyForwarder::addFace()
{
auto face = std::make_shared<DummyClientFace>(m_io, m_keyChain, DummyClientFace::Options{true, true});
DummyClientFace* self = &*face; // to prevent memory leak
- face->onSendInterest.connect([this, self] (const Interest& interest) {
- Interest i(interest);
+ face->onSendInterest.connect([this, self] (const auto& interest) {
+ ndn::Interest i(interest);
for (auto& otherFace : m_faces) {
if (self == &*otherFace) {
continue;
@@ -47,8 +48,8 @@
}
});
- face->onSendData.connect([this, self] (const Data& data) {
- Data d(data);
+ face->onSendData.connect([this, self] (const auto& data) {
+ ndn::Data d(data);
for (auto& otherFace : m_faces) {
if (self == &*otherFace) {
continue;
@@ -57,8 +58,8 @@
}
});
- face->onSendNack.connect([this, self] (const lp::Nack& nack) {
- lp::Nack n(nack);
+ face->onSendNack.connect([this, self] (const auto& nack) {
+ ndn::lp::Nack n(nack);
for (auto& otherFace : m_faces) {
if (self == &*otherFace) {
continue;
@@ -77,5 +78,4 @@
m_faces.clear();
}
-} // namespace chronosync
-} // namespace ndn
+} // namespace chronosync::tests
diff --git a/tests/unit-tests/dummy-forwarder.hpp b/tests/unit-tests/dummy-forwarder.hpp
index 372186e..379d3ce 100644
--- a/tests/unit-tests/dummy-forwarder.hpp
+++ b/tests/unit-tests/dummy-forwarder.hpp
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
- * Copyright (c) 2012-2023 University of California, Los Angeles
+ * Copyright (c) 2012-2024 University of California, Los Angeles
*
* This file is part of ChronoSync, synchronization library for distributed realtime
* applications for NDN.
@@ -26,11 +26,10 @@
#ifndef NDN_CHRONOSYNC_UNIT_TESTS_DUMMY_FORWARDER_HPP
#define NDN_CHRONOSYNC_UNIT_TESTS_DUMMY_FORWARDER_HPP
-namespace ndn {
-namespace chronosync {
+namespace chronosync::tests {
/**
- * @brief Very basic implementation of the dummy forwarder
+ * @brief Very basic implementation of a dummy forwarder.
*
* Interests expressed by any added face, will be forwarded to all other faces.
* Similarly, any pushed data, will be pushed to all other faces.
@@ -38,12 +37,12 @@
class DummyForwarder
{
public:
- DummyForwarder(boost::asio::io_context& io, KeyChain& keyChain);
+ DummyForwarder(boost::asio::io_context& io, ndn::KeyChain& keyChain);
- Face&
+ ndn::Face&
addFace();
- Face&
+ ndn::Face&
getFace(size_t nFace)
{
return *m_faces.at(nFace);
@@ -54,11 +53,10 @@
private:
boost::asio::io_context& m_io;
- KeyChain& m_keyChain;
- std::vector<std::shared_ptr<DummyClientFace>> m_faces;
+ ndn::KeyChain& m_keyChain;
+ std::vector<std::shared_ptr<ndn::DummyClientFace>> m_faces;
};
-} // namespace chronosync
-} // namespace ndn
+} // namespace chronosync::tests
#endif // NDN_CHRONOSYNC_UNIT_TESTS_DUMMY_FORWARDER_HPP
diff --git a/tests/unit-tests/test-diff-state.cpp b/tests/unit-tests/test-diff-state.cpp
index f71378a..56b8594 100644
--- a/tests/unit-tests/test-diff-state.cpp
+++ b/tests/unit-tests/test-diff-state.cpp
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
- * Copyright (c) 2012-2019 University of California, Los Angeles
+ * Copyright (c) 2012-2024 University of California, Los Angeles
*
* This file is part of ChronoSync, synchronization library for distributed realtime
* applications for NDN.
@@ -22,8 +22,7 @@
#include "tests/boost-test.hpp"
-namespace chronosync {
-namespace test {
+namespace chronosync::tests {
BOOST_AUTO_TEST_SUITE(DiffStateTests)
@@ -137,5 +136,4 @@
BOOST_AUTO_TEST_SUITE_END()
-} // namespace test
-} // namespace chronosync
+} // namespace chronosync::tests
diff --git a/tests/unit-tests/test-interest-table.cpp b/tests/unit-tests/test-interest-table.cpp
index 655762e..e99486d 100644
--- a/tests/unit-tests/test-interest-table.cpp
+++ b/tests/unit-tests/test-interest-table.cpp
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
- * Copyright (c) 2012-2022 University of California, Los Angeles
+ * Copyright (c) 2012-2024 University of California, Los Angeles
*
* This file is part of ChronoSync, synchronization library for distributed realtime
* applications for NDN.
@@ -24,8 +24,7 @@
#include <unistd.h>
-namespace chronosync {
-namespace test {
+namespace chronosync::tests {
class InterestTableFixture : public ndn::tests::UnitTestTimeFixture
{
@@ -71,7 +70,7 @@
ndn::ConstBufferPtr digest3;
};
-BOOST_FIXTURE_TEST_SUITE(InterestTableTest, InterestTableFixture)
+BOOST_FIXTURE_TEST_SUITE(InterestTableTests, InterestTableFixture)
BOOST_AUTO_TEST_CASE(Container)
{
@@ -143,5 +142,4 @@
BOOST_AUTO_TEST_SUITE_END()
-} // namespace test
-} // namespace chronosync
+} // namespace chronosync::tests
diff --git a/tests/unit-tests/test-leaf.cpp b/tests/unit-tests/test-leaf.cpp
index bc284b1..6c6a130 100644
--- a/tests/unit-tests/test-leaf.cpp
+++ b/tests/unit-tests/test-leaf.cpp
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
- * Copyright (c) 2012-2022 University of California, Los Angeles
+ * Copyright (c) 2012-2024 University of California, Los Angeles
*
* This file is part of ChronoSync, synchronization library for distributed realtime
* applications for NDN.
@@ -25,8 +25,7 @@
#include <ndn-cxx/encoding/buffer-stream.hpp>
#include <ndn-cxx/util/string-helper.hpp>
-namespace chronosync {
-namespace test {
+namespace chronosync::tests {
BOOST_AUTO_TEST_SUITE(LeafTests)
@@ -115,5 +114,4 @@
BOOST_AUTO_TEST_SUITE_END()
-} // namespace test
-} // namespace chronosync
+} // namespace chronosync::tests
diff --git a/tests/unit-tests/test-logic.cpp b/tests/unit-tests/test-logic.cpp
index 3cd7f9d..665a9d1 100644
--- a/tests/unit-tests/test-logic.cpp
+++ b/tests/unit-tests/test-logic.cpp
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
- * Copyright (c) 2012-2023 University of California, Los Angeles
+ * Copyright (c) 2012-2024 University of California, Los Angeles
*
* This file is part of ChronoSync, synchronization library for distributed realtime
* applications for NDN.
@@ -26,8 +26,7 @@
#include <ndn-cxx/util/random.hpp>
-namespace chronosync {
-namespace test {
+namespace chronosync::tests {
class Handler
{
@@ -81,7 +80,7 @@
Name syncPrefix;
Name userPrefix[4];
- ndn::chronosync::DummyForwarder fw;
+ DummyForwarder fw;
// std::unique_ptr<DummyClientFace> faces[4];
shared_ptr<Handler> handler[4];
@@ -456,5 +455,4 @@
BOOST_AUTO_TEST_SUITE_END()
-} // namespace test
-} // namespace chronosync
+} // namespace chronosync::tests
diff --git a/tests/unit-tests/test-multiple-user.cpp b/tests/unit-tests/test-multiple-user.cpp
index 83d00da..ad1d2ed 100644
--- a/tests/unit-tests/test-multiple-user.cpp
+++ b/tests/unit-tests/test-multiple-user.cpp
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
- * Copyright (c) 2012-2023 University of California, Los Angeles
+ * Copyright (c) 2012-2024 University of California, Los Angeles
*
* This file is part of ChronoSync, synchronization library for distributed realtime
* applications for NDN.
@@ -21,8 +21,7 @@
#include "tests/boost-test.hpp"
-namespace chronosync {
-namespace test {
+namespace chronosync::tests {
class Handler
{
@@ -102,5 +101,4 @@
BOOST_AUTO_TEST_SUITE_END()
-} // namespace test
-} // namespace chronosync
+} // namespace chronosync::tests
diff --git a/tests/unit-tests/test-socket.cpp b/tests/unit-tests/test-socket.cpp
index 3cde914..9913091 100644
--- a/tests/unit-tests/test-socket.cpp
+++ b/tests/unit-tests/test-socket.cpp
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
- * Copyright (c) 2012-2023 University of California, Los Angeles
+ * Copyright (c) 2012-2024 University of California, Los Angeles
*
* This file is part of ChronoSync, synchronization library for distributed realtime
* applications for NDN.
@@ -24,8 +24,7 @@
#include <ndn-cxx/util/dummy-client-face.hpp>
-namespace chronosync {
-namespace test {
+namespace chronosync::tests {
using std::string;
@@ -51,7 +50,7 @@
Logic::DEFAULT_NAME,
Logic::DEFAULT_VALIDATOR,
Logic::DEFAULT_SYNC_INTEREST_LIFETIME,
- name::Component::fromEscapedString("override"))
+ name::Component::fromUri("override"))
{
}
@@ -445,5 +444,4 @@
BOOST_AUTO_TEST_SUITE_END()
-} // namespace test
-} // namespace chronosync
+} // namespace chronosync::tests
diff --git a/tests/unit-tests/test-state.cpp b/tests/unit-tests/test-state.cpp
index a302f01..2d64b13 100644
--- a/tests/unit-tests/test-state.cpp
+++ b/tests/unit-tests/test-state.cpp
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
- * Copyright (c) 2012-2022 University of California, Los Angeles
+ * Copyright (c) 2012-2024 University of California, Los Angeles
*
* This file is part of ChronoSync, synchronization library for distributed realtime
* applications for NDN.
@@ -21,8 +21,7 @@
#include "tests/boost-test.hpp"
-namespace chronosync {
-namespace test {
+namespace chronosync::tests {
BOOST_AUTO_TEST_SUITE(StateTests)
@@ -211,5 +210,4 @@
BOOST_AUTO_TEST_SUITE_END()
-} // namespace test
-} // namespace chronosync
+} // namespace chronosync::tests