tests: sync common testing infrastructure with ndn-cxx
Change-Id: I6feab5247231abc35b8daa96bca21ad17c9cc4b3
diff --git a/tests/tools/mock-nfd-mgmt-fixture.hpp b/tests/tools/mock-nfd-mgmt-fixture.hpp
index 40dc3ba..7c02720 100644
--- a/tests/tools/mock-nfd-mgmt-fixture.hpp
+++ b/tests/tools/mock-nfd-mgmt-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,7 +26,7 @@
#ifndef NFD_TESTS_TOOLS_MOCK_NFD_MGMT_FIXTURE_HPP
#define NFD_TESTS_TOOLS_MOCK_NFD_MGMT_FIXTURE_HPP
-#include "tests/clock-fixture.hpp"
+#include "tests/io-fixture.hpp"
#include "tests/key-chain-fixture.hpp"
#include "tests/test-common.hpp"
@@ -45,12 +45,11 @@
/** \brief Fixture to emulate NFD management.
*/
-class MockNfdMgmtFixture : public ClockFixture, public KeyChainFixture
+class MockNfdMgmtFixture : public IoFixture, public KeyChainFixture
{
protected:
MockNfdMgmtFixture()
- : ClockFixture(m_io)
- , face(m_io, m_keyChain,
+ : face(m_io, m_keyChain,
{true, false, bind(&MockNfdMgmtFixture::processEventsOverride, this, _1)})
{
face.onSendInterest.connect([this] (const Interest& interest) {
@@ -206,9 +205,6 @@
signData(data);
}
-private:
- boost::asio::io_service m_io;
-
protected:
ndn::util::DummyClientFace face;
std::function<void(const Interest&)> processInterest;
diff --git a/tests/tools/nfdc/forwarder-general-module.t.cpp b/tests/tools/nfdc/forwarder-general-module.t.cpp
index ad282a3..5d2255b 100644
--- a/tests/tools/nfdc/forwarder-general-module.t.cpp
+++ b/tests/tools/nfdc/forwarder-general-module.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,8 +27,6 @@
#include "status-fixture.hpp"
-#include <ndn-cxx/security/signing-helpers.hpp>
-
namespace nfd {
namespace tools {
namespace nfdc {
diff --git a/tests/tools/nfdc/status-report.t.cpp b/tests/tools/nfdc/status-report.t.cpp
index 5041fb3..2ab5c3e 100644
--- a/tests/tools/nfdc/status-report.t.cpp
+++ b/tests/tools/nfdc/status-report.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -120,12 +120,11 @@
std::function<void()> processEventsFunc;
};
-class StatusReportModulesFixture : public ClockFixture, public KeyChainFixture
+class StatusReportModulesFixture : public IoFixture, public KeyChainFixture
{
protected:
StatusReportModulesFixture()
- : ClockFixture(m_io)
- , face(m_io, m_keyChain)
+ : face(m_io, m_keyChain)
, controller(face, m_keyChain, validator)
, res(0)
{
@@ -141,9 +140,7 @@
void
collect(time::nanoseconds tick, size_t nTicks)
{
- report.processEventsFunc = [=] {
- this->advanceClocks(tick, nTicks);
- };
+ report.processEventsFunc = [=] { advanceClocks(tick, nTicks); };
res = report.collect(face, m_keyChain, validator, CommandOptions());
if (res == 0) {
@@ -154,9 +151,6 @@
}
}
-private:
- boost::asio::io_service m_io;
-
protected:
ndn::util::DummyClientFace face;
ValidatorNull validator;