mgmt+rib: use getScheduler() in RibManager and Readvertise

Refs: #4528
Change-Id: Ie6dd2b0fbe5d57cd7878d86b0185ae5d9bd92cf0
diff --git a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
index 5576878..ea3ca10 100644
--- a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
+++ b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
@@ -42,7 +42,6 @@
 
   RibManagerSlAnnounceFixture()
     : m_face(g_io, m_keyChain)
-    , m_scheduler(g_io)
     , m_nfdController(m_face, m_keyChain)
     , m_dispatcher(m_face, m_keyChain)
     , m_fibUpdater(rib, m_nfdController)
@@ -55,7 +54,7 @@
     // Face, Controller, Dispatcher are irrelevant to SlAnnounce functions but required by
     // RibManager construction, so they are private. RibManager is a pointer to avoid code style
     // rule 1.4 violation.
-    manager = make_unique<RibManager>(rib, m_face, m_keyChain, m_nfdController, m_dispatcher, m_scheduler);
+    manager = make_unique<RibManager>(rib, m_face, m_keyChain, m_nfdController, m_dispatcher);
 
     loadTrustSchema();
   }
@@ -163,7 +162,6 @@
 
 private:
   ndn::util::DummyClientFace m_face;
-  Scheduler m_scheduler;
   ndn::nfd::Controller m_nfdController;
   Dispatcher m_dispatcher;
   rib::FibUpdater m_fibUpdater;
diff --git a/tests/daemon/mgmt/rib-manager.t.cpp b/tests/daemon/mgmt/rib-manager.t.cpp
index 9756a36..04d9dca 100644
--- a/tests/daemon/mgmt/rib-manager.t.cpp
+++ b/tests/daemon/mgmt/rib-manager.t.cpp
@@ -53,14 +53,12 @@
 class RibManagerFixture : public ManagerCommonFixture
 {
 public:
-  explicit
   RibManagerFixture(const ConfigurationStatus& status, bool shouldClearRib)
     : m_commands(m_face.sentInterests)
     , m_status(status)
-    , m_scheduler(g_io)
     , m_nfdController(m_face, m_keyChain)
     , m_fibUpdater(m_rib, m_nfdController)
-    , m_manager(m_rib, m_face, m_keyChain, m_nfdController, m_dispatcher, m_scheduler)
+    , m_manager(m_rib, m_face, m_keyChain, m_nfdController, m_dispatcher)
   {
     m_rib.mockFibResponse = [] (const rib::RibUpdateBatch& batch) {
       BOOST_CHECK(batch.begin() != batch.end());
@@ -205,7 +203,6 @@
   std::vector<Interest>& m_commands;
   ConfigurationStatus m_status;
 
-  Scheduler m_scheduler;
   ndn::nfd::Controller m_nfdController;
   rib::Rib m_rib;
   rib::FibUpdater m_fibUpdater;
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 1b357cb..c455065 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-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -38,8 +38,9 @@
 class HostToGatewayReadvertisePolicyFixture : public IdentityManagementFixture
 {
 public:
-  RibRouteRef
-  makeNewRoute(const Name& prefix) {
+  static RibRouteRef
+  makeNewRoute(const Name& prefix)
+  {
     auto entry = make_shared<RibEntry>();
     entry->setName(prefix);
 
@@ -56,8 +57,7 @@
 };
 
 BOOST_AUTO_TEST_SUITE(Readvertise)
-BOOST_FIXTURE_TEST_SUITE(TestHostToGatewayReadvertisePolicy,
-                         HostToGatewayReadvertisePolicyFixture)
+BOOST_FIXTURE_TEST_SUITE(TestHostToGatewayReadvertisePolicy, HostToGatewayReadvertisePolicyFixture)
 
 BOOST_AUTO_TEST_CASE(PrefixToAdvertise)
 {
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 d3ec057..e3afcbf 100644
--- a/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
+++ b/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
@@ -44,11 +44,10 @@
     : nSuccessCallbacks(0)
     , nFailureCallbacks(0)
     , face(g_io, m_keyChain, {true, false})
-    , scheduler(g_io)
     , controller(face, m_keyChain)
     , dest(controller, rib, ndn::nfd::CommandOptions().setPrefix("/localhost/nlsr"))
     , successCallback([this] { nSuccessCallbacks++; })
-    , failureCallback([this] (const std::string& str) { nFailureCallbacks++; })
+    , failureCallback([this] (const std::string&) { nFailureCallbacks++; })
   {
   }
 
@@ -58,7 +57,6 @@
 
 protected:
   ndn::util::DummyClientFace face;
-  Scheduler scheduler;
   ndn::nfd::Controller controller;
   Rib rib;
   NfdRibReadvertiseDestination dest;
diff --git a/tests/daemon/rib/readvertise/readvertise.t.cpp b/tests/daemon/rib/readvertise/readvertise.t.cpp
index f73efbd..d2d8bb2 100644
--- a/tests/daemon/rib/readvertise/readvertise.t.cpp
+++ b/tests/daemon/rib/readvertise/readvertise.t.cpp
@@ -41,7 +41,7 @@
 {
 public:
   optional<ReadvertiseAction>
-  handleNewRoute(const RibRouteRef& route) const override
+  handleNewRoute(const RibRouteRef&) const override
   {
     return this->decision;
   }
@@ -49,7 +49,7 @@
   time::milliseconds
   getRefreshInterval() const override
   {
-    return time::seconds(60);
+    return 1_min;
   }
 
 public:
@@ -115,14 +115,12 @@
 public:
   ReadvertiseFixture()
     : m_face(g_io, m_keyChain, {false, false})
-    , m_scheduler(g_io)
   {
-    auto policyUnique = make_unique<DummyReadvertisePolicy>();
-    policy = policyUnique.get();
-    auto destinationUnique = make_unique<DummyReadvertiseDestination>();
-    destination = destinationUnique.get();
-    readvertise = make_unique<Readvertise>(m_rib, m_scheduler,
-                                           std::move(policyUnique), std::move(destinationUnique));
+    auto policyPtr = make_unique<DummyReadvertisePolicy>();
+    policy = policyPtr.get();
+    auto destinationPtr = make_unique<DummyReadvertiseDestination>();
+    destination = destinationPtr.get();
+    readvertise = make_unique<Readvertise>(m_rib, std::move(policyPtr), std::move(destinationPtr));
   }
 
   void
@@ -159,7 +157,6 @@
 
 private:
   ndn::util::DummyClientFace m_face;
-  Scheduler m_scheduler;
   Rib m_rib;
 };