tests: introduce ClockFixture
Identical to UnitTestTimeFixture, except that it does not derive
from BaseFixture, and thus does not depend on a global io_service.
Refs: #4528
Change-Id: Ia2e6c4835a1e461c73281e103109d5cc85be355e
diff --git a/tests/tools/nfdc/status-report.t.cpp b/tests/tools/nfdc/status-report.t.cpp
index 6b1cd20..7c8e32c 100644
--- a/tests/tools/nfdc/status-report.t.cpp
+++ b/tests/tools/nfdc/status-report.t.cpp
@@ -120,11 +120,12 @@
std::function<void()> processEventsFunc;
};
-class StatusReportModulesFixture : public UnitTestTimeFixture, public KeyChainFixture
+class StatusReportModulesFixture : public ClockFixture, public KeyChainFixture
{
protected:
StatusReportModulesFixture()
- : face(g_io, m_keyChain)
+ : ClockFixture(m_io)
+ , face(m_io, m_keyChain)
, controller(face, m_keyChain, validator)
, res(0)
{
@@ -133,7 +134,7 @@
DummyModule&
addModule(const std::string& moduleName)
{
- report.sections.push_back(make_unique<DummyModule>(moduleName, g_io));
+ report.sections.push_back(make_unique<DummyModule>(moduleName, m_io));
return static_cast<DummyModule&>(*report.sections.back());
}
@@ -153,6 +154,9 @@
}
}
+private:
+ boost::asio::io_service m_io;
+
protected:
ndn::util::DummyClientFace face;
ValidatorNull validator;
@@ -164,7 +168,6 @@
output_test_stream statusText;
};
-
BOOST_AUTO_TEST_SUITE(Nfdc)
BOOST_FIXTURE_TEST_SUITE(TestStatusReport, StatusReportModulesFixture)