tests: don't use makeDummyClientFace
refs #3383
Change-Id: I1803a6f482a4e6bf43363cd08a73c4bbcb26d0a2
diff --git a/tests/rib/auto-prefix-propagator.t.cpp b/tests/rib/auto-prefix-propagator.t.cpp
index 2429179..7db7510 100644
--- a/tests/rib/auto-prefix-propagator.t.cpp
+++ b/tests/rib/auto-prefix-propagator.t.cpp
@@ -33,20 +33,22 @@
namespace rib {
namespace tests {
+using namespace nfd::tests;
+
NFD_LOG_INIT("AutoPrefixPropagatorTest");
const Name TEST_LINK_LOCAL_NFD_PREFIX("/localhop/nfd");
const time::milliseconds TEST_PREFIX_PROPAGATION_TIMEOUT(1000);
-class AutoPrefixPropagatorFixture : public nfd::tests::IdentityManagementFixture
- , public nfd::tests::UnitTestTimeFixture
+class AutoPrefixPropagatorFixture : public IdentityManagementFixture
+ , public UnitTestTimeFixture
{
public:
AutoPrefixPropagatorFixture()
- : m_face(ndn::util::makeDummyClientFace(nfd::tests::UnitTestTimeFixture::g_io, {true, true}))
- , m_controller(*m_face, m_keyChain)
+ : m_face(getGlobalIoService(), m_keyChain, {true, true})
+ , m_controller(m_face, m_keyChain)
, m_propagator(m_controller, m_keyChain, m_rib)
- , m_requests(m_face->sentInterests)
+ , m_requests(m_face.sentInterests)
, m_entries(m_propagator.m_propagatedEntries)
{
m_propagator.enable();
@@ -173,12 +175,12 @@
}
protected:
- shared_ptr<ndn::util::DummyClientFace> m_face;
- ndn::nfd::Controller m_controller;
- Rib m_rib;
- AutoPrefixPropagator m_propagator;
- std::vector<Interest>& m_requests; // store sent out requests
- AutoPrefixPropagator::PropagatedEntryList& m_entries; // store propagated entries
+ ndn::util::DummyClientFace m_face;
+ ndn::nfd::Controller m_controller;
+ Rib m_rib;
+ AutoPrefixPropagator m_propagator;
+ std::vector<Interest>& m_requests; ///< store sent out requests
+ AutoPrefixPropagator::PropagatedEntryList& m_entries; ///< store propagated entries
};
std::ostream&
diff --git a/tests/rib/fib-updates-common.hpp b/tests/rib/fib-updates-common.hpp
index 34ae41d..1f293c6 100644
--- a/tests/rib/fib-updates-common.hpp
+++ b/tests/rib/fib-updates-common.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014-2015, Regents of the University of California,
+ * Copyright (c) 2014-2016, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -23,8 +23,9 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "rib-test-common.hpp"
#include "rib/fib-updater.hpp"
+#include "rib-test-common.hpp"
+#include "tests/identity-management-fixture.hpp"
#include <ndn-cxx/util/dummy-client-face.hpp>
@@ -32,6 +33,8 @@
namespace rib {
namespace tests {
+using namespace nfd::tests;
+
inline bool
compareNameFaceIdCostAction(const FibUpdate& lhs, const FibUpdate& rhs)
{
@@ -55,12 +58,12 @@
return false;
}
-class FibUpdatesFixture : public nfd::tests::BaseFixture
+class FibUpdatesFixture : public IdentityManagementFixture
{
public:
FibUpdatesFixture()
- : face(ndn::util::makeDummyClientFace())
- , controller(*face, keyChain)
+ : face(getGlobalIoService(), m_keyChain)
+ , controller(face, m_keyChain)
, fibUpdater(rib, controller)
{
}
@@ -163,8 +166,7 @@
}
public:
- shared_ptr<ndn::util::DummyClientFace> face;
- ndn::KeyChain keyChain;
+ ndn::util::DummyClientFace face;
ndn::nfd::Controller controller;
rib::FibUpdater fibUpdater;
rib::Rib rib;
diff --git a/tests/rib/rib-manager.t.cpp b/tests/rib/rib-manager.t.cpp
index 610c61d..30d1e1e 100644
--- a/tests/rib/rib-manager.t.cpp
+++ b/tests/rib/rib-manager.t.cpp
@@ -49,9 +49,9 @@
explicit
RibManagerFixture(const ConfigurationStatus& status,
bool shouldClearRib)
- : m_commands(m_face->sentInterests)
+ : m_commands(m_face.sentInterests)
, m_status(status)
- , m_manager(m_dispatcher, *m_face, m_keyChain)
+ , m_manager(m_dispatcher, m_face, m_keyChain)
, m_rib(m_manager.m_rib)
{
m_rib.m_onSendBatchFromQueue = bind(&RibManagerFixture::onSendBatchFromQueue, this, _1);
@@ -112,7 +112,7 @@
m_keyChain.sign(*data, ndn::security::SigningInfo(ndn::security::SigningInfo::SIGNER_TYPE_SHA256));
- m_face->getIoService().post([this, data] { m_face->receive(*data); });
+ m_face.getIoService().post([this, data] { m_face.receive(*data); });
};
Name commandPrefix("/localhost/nfd/fib/add-nexthop");
diff --git a/tests/rib/rib-status-publisher-common.hpp b/tests/rib/rib-status-publisher-common.hpp
index eee9a5e..3fc7fad 100644
--- a/tests/rib/rib-status-publisher-common.hpp
+++ b/tests/rib/rib-status-publisher-common.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014-2015, Regents of the University of California,
+ * Copyright (c) 2014-2016, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,9 +27,10 @@
#define RIB_TESTS_UNIT_TESTS_RIB_STATUS_PUBLISHER_COMMON_HPP
#include "rib/rib-status-publisher.hpp"
+#include "rib/rib.hpp"
#include "tests/test-common.hpp"
-#include "rib/rib.hpp"
+#include "tests/identity-management-fixture.hpp"
#include <ndn-cxx/management/nfd-control-parameters.hpp>
#include <ndn-cxx/management/nfd-rib-entry.hpp>
@@ -40,9 +41,11 @@
namespace rib {
namespace tests {
+using namespace nfd::tests;
+
using ndn::nfd::ControlParameters;
-class RibStatusPublisherFixture : public nfd::tests::BaseFixture
+class RibStatusPublisherFixture : public IdentityManagementFixture
{
public:
static void
diff --git a/tests/rib/rib-status-publisher.t.cpp b/tests/rib/rib-status-publisher.t.cpp
index 55ba64f..9600d10 100644
--- a/tests/rib/rib-status-publisher.t.cpp
+++ b/tests/rib/rib-status-publisher.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014-2015, Regents of the University of California,
+ * Copyright (c) 2014-2016, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -47,15 +47,14 @@
route.flags = ndn::nfd::ROUTE_FLAG_CAPTURE;
rib.insert(name, route);
- ndn::KeyChain keyChain;
- shared_ptr<ndn::util::DummyClientFace> face = ndn::util::makeDummyClientFace();
- RibStatusPublisher publisher(rib, *face, "/localhost/nfd/rib/list", keyChain);
+ ndn::util::DummyClientFace face(getGlobalIoService(), m_keyChain);
+ RibStatusPublisher publisher(rib, face, "/localhost/nfd/rib/list", m_keyChain);
publisher.publish();
- face->processEvents(time::milliseconds(1));
+ face.processEvents(time::milliseconds(1));
- BOOST_REQUIRE_EQUAL(face->sentDatas.size(), 1);
- decodeRibEntryBlock(face->sentDatas[0], name, route);
+ BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
+ decodeRibEntryBlock(face.sentData[0], name, route);
}