Refactor and modernize namespace declarations
Move all unit tests to namespace nfd::tests
Delete unused header core/algorithm.hpp
Change-Id: I5591f0c5f3bb5db67f8b45fae95471f8a555ca68
diff --git a/tests/daemon/rib/rib.t.cpp b/tests/daemon/rib/rib.t.cpp
index cc96e79..b635207 100644
--- a/tests/daemon/rib/rib.t.cpp
+++ b/tests/daemon/rib/rib.t.cpp
@@ -29,11 +29,9 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/rib/create-route.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using rib::Route;
BOOST_FIXTURE_TEST_SUITE(TestRib, GlobalIoFixture)
@@ -239,39 +237,37 @@
Route route1 = createRoute(1, 20, 10);
Route route2 = createRoute(2, 30, 20);
- RibRouteRef routeInfo;
-
int nAfterInsertEntryInvocations = 0;
int nAfterAddRouteInvocations = 0;
int nBeforeRemoveRouteInvocations = 0;
int nAfterEraseEntryInvocations = 0;
- rib.afterInsertEntry.connect([&] (const Name& inName) {
- BOOST_CHECK_EQUAL(nAfterInsertEntryInvocations, 0);
- BOOST_CHECK_EQUAL(nAfterAddRouteInvocations, 0);
- BOOST_CHECK(rib.find(name) != rib.end());
- nAfterInsertEntryInvocations++;
- });
+ rib.afterInsertEntry.connect([&] (const auto&) {
+ BOOST_CHECK_EQUAL(nAfterInsertEntryInvocations, 0);
+ BOOST_CHECK_EQUAL(nAfterAddRouteInvocations, 0);
+ BOOST_CHECK(rib.find(name) != rib.end());
+ nAfterInsertEntryInvocations++;
+ });
- rib.afterAddRoute.connect([&] (const RibRouteRef& rrr) {
- BOOST_CHECK_EQUAL(nAfterInsertEntryInvocations, 1);
- BOOST_CHECK(rib.find(name) != rib.end());
- BOOST_CHECK(rib.find(name, route) != nullptr);
- nAfterAddRouteInvocations++;
- });
+ rib.afterAddRoute.connect([&] (const auto&) {
+ BOOST_CHECK_EQUAL(nAfterInsertEntryInvocations, 1);
+ BOOST_CHECK(rib.find(name) != rib.end());
+ BOOST_CHECK(rib.find(name, route) != nullptr);
+ nAfterAddRouteInvocations++;
+ });
- rib.beforeRemoveRoute.connect([&] (const RibRouteRef& rrr) {
- BOOST_CHECK_EQUAL(nAfterEraseEntryInvocations, 0);
- BOOST_CHECK(rib.find(name) != rib.end());
- BOOST_CHECK(rib.find(name, route) != nullptr);
- nBeforeRemoveRouteInvocations++;
- });
+ rib.beforeRemoveRoute.connect([&] (const auto&) {
+ BOOST_CHECK_EQUAL(nAfterEraseEntryInvocations, 0);
+ BOOST_CHECK(rib.find(name) != rib.end());
+ BOOST_CHECK(rib.find(name, route) != nullptr);
+ nBeforeRemoveRouteInvocations++;
+ });
- rib.afterEraseEntry.connect([&] (const Name& inName) {
- BOOST_CHECK_EQUAL(nBeforeRemoveRouteInvocations, 2);
- BOOST_CHECK_EQUAL(nAfterEraseEntryInvocations, 0);
- BOOST_CHECK(rib.find(name) == rib.end());
- nAfterEraseEntryInvocations++;
- });
+ rib.afterEraseEntry.connect([&] (const auto&) {
+ BOOST_CHECK_EQUAL(nBeforeRemoveRouteInvocations, 2);
+ BOOST_CHECK_EQUAL(nAfterEraseEntryInvocations, 0);
+ BOOST_CHECK(rib.find(name) == rib.end());
+ nAfterEraseEntryInvocations++;
+ });
route = route1;
rib.insert(name, route);
@@ -333,6 +329,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestRib
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests