tests: merge unit-tests-rib into unit-tests-daemon

Change-Id: If522cdb43a2686030f4fd4c2d2e25f1b50c54681
diff --git a/tests/daemon/rib/fib-updates-erase-face.t.cpp b/tests/daemon/rib/fib-updates-erase-face.t.cpp
index a911d5e..43ec2f0 100644
--- a/tests/daemon/rib/fib-updates-erase-face.t.cpp
+++ b/tests/daemon/rib/fib-updates-erase-face.t.cpp
@@ -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,
@@ -30,8 +30,8 @@
 
 namespace nfd::tests {
 
+BOOST_AUTO_TEST_SUITE(Rib)
 BOOST_FIXTURE_TEST_SUITE(TestFibUpdates, FibUpdatesFixture)
-
 BOOST_AUTO_TEST_SUITE(EraseFace)
 
 BOOST_AUTO_TEST_CASE(WithInheritedFace_Root)
@@ -421,7 +421,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // EraseFace
-
 BOOST_AUTO_TEST_SUITE_END() // FibUpdates
+BOOST_AUTO_TEST_SUITE_END() // Rib
 
 } // namespace nfd::tests
diff --git a/tests/daemon/rib/fib-updates-new-face.t.cpp b/tests/daemon/rib/fib-updates-new-face.t.cpp
index 79924df..0497a15 100644
--- a/tests/daemon/rib/fib-updates-new-face.t.cpp
+++ b/tests/daemon/rib/fib-updates-new-face.t.cpp
@@ -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,
@@ -30,8 +30,8 @@
 
 namespace nfd::tests {
 
+BOOST_AUTO_TEST_SUITE(Rib)
 BOOST_FIXTURE_TEST_SUITE(TestFibUpdates, FibUpdatesFixture)
-
 BOOST_AUTO_TEST_SUITE(NewFace)
 
 BOOST_AUTO_TEST_CASE(Basic)
@@ -262,7 +262,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // NewFace
-
 BOOST_AUTO_TEST_SUITE_END() // FibUpdates
+BOOST_AUTO_TEST_SUITE_END() // Rib
 
 } // namespace nfd::tests
diff --git a/tests/daemon/rib/fib-updates-new-namespace.t.cpp b/tests/daemon/rib/fib-updates-new-namespace.t.cpp
index 4ceb60b..084cf40 100644
--- a/tests/daemon/rib/fib-updates-new-namespace.t.cpp
+++ b/tests/daemon/rib/fib-updates-new-namespace.t.cpp
@@ -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,
@@ -30,8 +30,8 @@
 
 namespace nfd::tests {
 
+BOOST_AUTO_TEST_SUITE(Rib)
 BOOST_FIXTURE_TEST_SUITE(TestFibUpdates, FibUpdatesFixture)
-
 BOOST_AUTO_TEST_SUITE(NewNamespace)
 
 BOOST_AUTO_TEST_CASE(NoFlags)
@@ -190,7 +190,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // NewNamespace
-
 BOOST_AUTO_TEST_SUITE_END() // FibUpdates
+BOOST_AUTO_TEST_SUITE_END() // Rib
 
 } // namespace nfd::tests
diff --git a/tests/daemon/rib/fib-updates-update-face.t.cpp b/tests/daemon/rib/fib-updates-update-face.t.cpp
index bb76d01..3e8e987 100644
--- a/tests/daemon/rib/fib-updates-update-face.t.cpp
+++ b/tests/daemon/rib/fib-updates-update-face.t.cpp
@@ -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,
@@ -30,8 +30,8 @@
 
 namespace nfd::tests {
 
+BOOST_AUTO_TEST_SUITE(Rib)
 BOOST_FIXTURE_TEST_SUITE(TestFibUpdates, FibUpdatesFixture)
-
 BOOST_AUTO_TEST_SUITE(UpdateFace)
 
 BOOST_AUTO_TEST_CASE(TurnOffChildInheritLowerCost)
@@ -256,7 +256,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // UpdateFace
-
 BOOST_AUTO_TEST_SUITE_END() // FibUpdates
+BOOST_AUTO_TEST_SUITE_END() // Rib
 
 } // namespace nfd::tests
diff --git a/tests/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp b/tests/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp
index eab14e8..ff78b40 100644
--- a/tests/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp
+++ b/tests/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp
@@ -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,
@@ -32,7 +32,7 @@
 
 using namespace nfd::rib;
 
-BOOST_AUTO_TEST_SUITE(Readvertise)
+BOOST_AUTO_TEST_SUITE(Rib)
 BOOST_FIXTURE_TEST_SUITE(TestClientToNlsrReadvertisePolicy, GlobalIoFixture)
 
 BOOST_AUTO_TEST_CASE(ReadvertiseClientRoute)
@@ -68,6 +68,6 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestClientToNlsrReadvertisePolicy
-BOOST_AUTO_TEST_SUITE_END() // Readvertise
+BOOST_AUTO_TEST_SUITE_END() // Rib
 
 } // namespace nfd::tests
diff --git a/tests/daemon/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp b/tests/daemon/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp
index df73058..e9979d2 100644
--- a/tests/daemon/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp
+++ b/tests/daemon/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp
@@ -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,
@@ -54,7 +54,7 @@
   }
 };
 
-BOOST_AUTO_TEST_SUITE(Readvertise)
+BOOST_AUTO_TEST_SUITE(Rib)
 BOOST_FIXTURE_TEST_SUITE(TestHostToGatewayReadvertisePolicy, HostToGatewayReadvertisePolicyFixture)
 
 BOOST_AUTO_TEST_CASE(PrefixToAdvertise)
@@ -105,6 +105,6 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestHostToGatewayReadvertisePolicy
-BOOST_AUTO_TEST_SUITE_END() // Readvertise
+BOOST_AUTO_TEST_SUITE_END() // Rib
 
 } // namespace nfd::tests
diff --git a/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp b/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
index 996ff37..caf38aa 100644
--- a/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
+++ b/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
@@ -65,7 +65,7 @@
   std::function<void(const std::string&)> failureCallback;
 };
 
-BOOST_AUTO_TEST_SUITE(Readvertise)
+BOOST_AUTO_TEST_SUITE(Rib)
 BOOST_FIXTURE_TEST_SUITE(TestNfdRibReadvertiseDestination, NfdRibReadvertiseDestinationFixture)
 
 class AdvertiseSuccessScenario
@@ -249,6 +249,6 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestNfdRibReadvertiseDestination
-BOOST_AUTO_TEST_SUITE_END() // Readvertise
+BOOST_AUTO_TEST_SUITE_END() // Rib
 
 } // namespace nfd::tests
diff --git a/tests/daemon/rib/readvertise/readvertise.t.cpp b/tests/daemon/rib/readvertise/readvertise.t.cpp
index 06f905f..7f83dfc 100644
--- a/tests/daemon/rib/readvertise/readvertise.t.cpp
+++ b/tests/daemon/rib/readvertise/readvertise.t.cpp
@@ -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,
@@ -161,7 +161,7 @@
   Rib m_rib;
 };
 
-BOOST_AUTO_TEST_SUITE(Readvertise)
+BOOST_AUTO_TEST_SUITE(Rib)
 BOOST_FIXTURE_TEST_SUITE(TestReadvertise, ReadvertiseFixture)
 
 BOOST_AUTO_TEST_CASE(AddRemoveRoute)
@@ -296,6 +296,6 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestReadvertise
-BOOST_AUTO_TEST_SUITE_END() // Readvertise
+BOOST_AUTO_TEST_SUITE_END() // Rib
 
 } // namespace nfd::tests
diff --git a/tests/daemon/rib/rib-entry.t.cpp b/tests/daemon/rib/rib-entry.t.cpp
index 903313e..f6e61ea 100644
--- a/tests/daemon/rib/rib-entry.t.cpp
+++ b/tests/daemon/rib/rib-entry.t.cpp
@@ -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,
@@ -33,6 +33,7 @@
 using rib::RibEntry;
 using rib::Route;
 
+BOOST_AUTO_TEST_SUITE(Rib)
 BOOST_FIXTURE_TEST_SUITE(TestRibEntry, GlobalIoFixture)
 
 BOOST_AUTO_TEST_CASE(Basic)
@@ -78,18 +79,13 @@
 BOOST_FIXTURE_TEST_SUITE(GetAnnouncement, GlobalIoTimeFixture)
 
 static Route
-makeSimpleRoute(uint64_t faceId)
+makeSimpleRoute(uint64_t faceId, std::optional<time::nanoseconds> expiration = std::nullopt)
 {
   Route route;
   route.faceId = faceId;
-  return route;
-}
-
-static Route
-makeSimpleRoute(uint64_t faceId, time::nanoseconds expiration)
-{
-  Route route = makeSimpleRoute(faceId);
-  route.expires = time::steady_clock::now() + expiration;
+  if (expiration) {
+    route.expires = time::steady_clock::now() + *expiration;
+  }
   return route;
 }
 
@@ -170,5 +166,6 @@
 BOOST_AUTO_TEST_SUITE_END() // GetAnnouncement
 
 BOOST_AUTO_TEST_SUITE_END() // TestRibEntry
+BOOST_AUTO_TEST_SUITE_END() // Rib
 
 } // namespace nfd::tests
diff --git a/tests/daemon/rib/rib-update.t.cpp b/tests/daemon/rib/rib-update.t.cpp
index 533439a..0941693 100644
--- a/tests/daemon/rib/rib-update.t.cpp
+++ b/tests/daemon/rib/rib-update.t.cpp
@@ -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,
@@ -33,9 +33,10 @@
 
 using namespace nfd::rib;
 
+BOOST_AUTO_TEST_SUITE(Rib)
 BOOST_AUTO_TEST_SUITE(TestRibUpdate)
 
-BOOST_AUTO_TEST_CASE(BatchBasic)
+BOOST_AUTO_TEST_CASE(Batch)
 {
   const uint64_t faceId = 1;
   RibUpdateBatch batch(faceId);
@@ -75,5 +76,6 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestRibUpdate
+BOOST_AUTO_TEST_SUITE_END() // Rib
 
 } // namespace nfd::tests
diff --git a/tests/daemon/rib/rib.t.cpp b/tests/daemon/rib/rib.t.cpp
index ad42323..d8ef5e1 100644
--- a/tests/daemon/rib/rib.t.cpp
+++ b/tests/daemon/rib/rib.t.cpp
@@ -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,
@@ -35,6 +35,7 @@
 
 using rib::Route;
 
+BOOST_AUTO_TEST_SUITE(Rib)
 BOOST_FIXTURE_TEST_SUITE(TestRib, GlobalIoFixture)
 
 BOOST_AUTO_TEST_CASE(Parent)
@@ -229,7 +230,7 @@
   BOOST_CHECK_EQUAL(rib.size(), 1);
 }
 
-BOOST_AUTO_TEST_CASE(RibSignals)
+BOOST_AUTO_TEST_CASE(Signals)
 {
   rib::Rib rib;
 
@@ -292,7 +293,7 @@
   BOOST_CHECK_EQUAL(nAfterEraseEntryInvocations, 1);
 }
 
-BOOST_AUTO_TEST_CASE(Output)
+BOOST_AUTO_TEST_CASE(Print)
 {
   rib::Rib rib;
 
@@ -330,5 +331,6 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestRib
+BOOST_AUTO_TEST_SUITE_END() // Rib
 
 } // namespace nfd::tests
diff --git a/tests/daemon/rib/route.t.cpp b/tests/daemon/rib/route.t.cpp
index c51e964..7133628 100644
--- a/tests/daemon/rib/route.t.cpp
+++ b/tests/daemon/rib/route.t.cpp
@@ -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,
@@ -34,6 +34,7 @@
 
 using rib::Route;
 
+BOOST_AUTO_TEST_SUITE(Rib)
 BOOST_FIXTURE_TEST_SUITE(TestRoute, GlobalIoTimeFixture)
 
 BOOST_AUTO_TEST_SUITE(CreateFromAnnouncement)
@@ -123,10 +124,7 @@
   a.expires = std::nullopt;
 
   BOOST_CHECK_EQUAL(a, b);
-}
 
-BOOST_AUTO_TEST_CASE(EqualityAnn)
-{
   auto ann1 = makePrefixAnn("/ann", 1_h);
   auto ann2 = makePrefixAnn("/ann", 2_h);
   BOOST_CHECK_EQUAL(Route(ann1, 7001), Route(ann1, 7001));
@@ -134,7 +132,7 @@
   BOOST_CHECK_NE(Route(ann1, 7001), Route(ann2, 7001));
 }
 
-BOOST_AUTO_TEST_CASE(Output)
+BOOST_AUTO_TEST_CASE(Print)
 {
   Route r;
   BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(r),
@@ -160,5 +158,6 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestRoute
+BOOST_AUTO_TEST_SUITE_END() // Rib
 
 } // namespace nfd::tests
diff --git a/tests/daemon/rib/service.t.cpp b/tests/daemon/rib/service.t.cpp
index 51189fc..9923efc 100644
--- a/tests/daemon/rib/service.t.cpp
+++ b/tests/daemon/rib/service.t.cpp
@@ -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,
@@ -56,6 +56,7 @@
   ndn::KeyChain m_ribKeyChain;
 };
 
+BOOST_AUTO_TEST_SUITE(Rib)
 BOOST_FIXTURE_TEST_SUITE(TestService, RibServiceFixture)
 
 BOOST_AUTO_TEST_CASE(Basic)
@@ -146,5 +147,6 @@
 BOOST_AUTO_TEST_SUITE_END() // ProcessConfig
 
 BOOST_AUTO_TEST_SUITE_END() // TestService
+BOOST_AUTO_TEST_SUITE_END() // Rib
 
 } // namespace nfd::tests