rib: change FIB update mocking method
Previously, FIB update mocking occurs in Rib class. Test coverage
for FibUpdater class is limited to update computation only.
Now, mocking is moved to a subclass of FibUpdater. Test coverage
for FibUpdater class extends to include FIB update queuing.
Previously, mocked FIB update succeeds synchronously.
Now, mocked FIB update completes via io.post, which better
reflects reality that FIB commands are asynchronous.
refs #4731
Change-Id: I563edda5d398eb915f22fecd4b987f32c610d323
diff --git a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
index 2afa8fd..83d7a64 100644
--- a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
+++ b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
@@ -24,11 +24,11 @@
*/
#include "mgmt/rib-manager.hpp"
-#include "rib/fib-updater.hpp"
#include "tests/test-common.hpp"
#include "tests/key-chain-fixture.hpp"
#include "tests/daemon/global-io-fixture.hpp"
+#include "tests/daemon/rib/fib-updates-common.hpp"
#include <ndn-cxx/util/dummy-client-face.hpp>
@@ -50,9 +50,6 @@
, m_trustedSigner(m_keyChain.createIdentity("/trusted", ndn::RsaKeyParams()))
, m_untrustedSigner(m_keyChain.createIdentity("/untrusted", ndn::RsaKeyParams()))
{
- rib.mockFibResponse = [] (const auto&) { return true; };
- rib.wantMockFibResponseOnce = false;
-
// 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.
@@ -166,7 +163,7 @@
ndn::util::DummyClientFace m_face;
ndn::nfd::Controller m_nfdController;
Dispatcher m_dispatcher;
- rib::FibUpdater m_fibUpdater;
+ rib::tests::MockFibUpdater m_fibUpdater;
ndn::security::SigningInfo m_trustedSigner;
ndn::security::SigningInfo m_untrustedSigner;