tests: unit-tests-{core,tools} no longer require a global io_service
BaseFixture is moved to tests/daemon and renamed to GlobalIoFixture
Refs: #4528
Change-Id: If9184e9f7f1d6072b0103d3ea3ca6c31a9e505c8
diff --git a/tests/daemon/table/cleanup.t.cpp b/tests/daemon/table/cleanup.t.cpp
index c6bd772..25405a6 100644
--- a/tests/daemon/table/cleanup.t.cpp
+++ b/tests/daemon/table/cleanup.t.cpp
@@ -27,15 +27,14 @@
#include "fw/forwarder.hpp"
#include "tests/test-common.hpp"
+#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/face/dummy-face.hpp"
namespace nfd {
namespace tests {
-using namespace nfd::tests;
-
BOOST_AUTO_TEST_SUITE(Table)
-BOOST_FIXTURE_TEST_SUITE(TestCleanup, BaseFixture)
+BOOST_FIXTURE_TEST_SUITE(TestCleanup, GlobalIoFixture)
BOOST_AUTO_TEST_SUITE(FaceRemoval)
diff --git a/tests/daemon/table/cs-policy-lru.t.cpp b/tests/daemon/table/cs-policy-lru.t.cpp
index 7466510..bc28639 100644
--- a/tests/daemon/table/cs-policy-lru.t.cpp
+++ b/tests/daemon/table/cs-policy-lru.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, 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,
@@ -27,6 +27,7 @@
#include "table/cs.hpp"
#include "tests/test-common.hpp"
+#include "tests/daemon/global-io-fixture.hpp"
namespace nfd {
namespace cs {
@@ -43,7 +44,7 @@
BOOST_CHECK_EQUAL(policyNames.count("lru"), 1);
}
-BOOST_FIXTURE_TEST_CASE(EvictOne, UnitTestTimeFixture)
+BOOST_FIXTURE_TEST_CASE(EvictOne, GlobalIoTimeFixture)
{
Cs cs(3);
cs.setPolicy(make_unique<LruPolicy>());
diff --git a/tests/daemon/table/cs-policy-priority-fifo.t.cpp b/tests/daemon/table/cs-policy-priority-fifo.t.cpp
index b68729a..cd71b5b 100644
--- a/tests/daemon/table/cs-policy-priority-fifo.t.cpp
+++ b/tests/daemon/table/cs-policy-priority-fifo.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, 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,
@@ -27,6 +27,7 @@
#include "table/cs.hpp"
#include "tests/test-common.hpp"
+#include "tests/daemon/global-io-fixture.hpp"
namespace nfd {
namespace cs {
@@ -43,7 +44,7 @@
BOOST_CHECK_EQUAL(policyNames.count("priority_fifo"), 1);
}
-BOOST_FIXTURE_TEST_CASE(EvictOne, UnitTestTimeFixture)
+BOOST_FIXTURE_TEST_CASE(EvictOne, GlobalIoTimeFixture)
{
Cs cs(3);
cs.setPolicy(make_unique<PriorityFifoPolicy>());
@@ -96,7 +97,7 @@
bind([] { BOOST_CHECK(true); }));
}
-BOOST_FIXTURE_TEST_CASE(Refresh, UnitTestTimeFixture)
+BOOST_FIXTURE_TEST_CASE(Refresh, GlobalIoTimeFixture)
{
Cs cs(3);
cs.setPolicy(make_unique<PriorityFifoPolicy>());
diff --git a/tests/daemon/table/cs.t.cpp b/tests/daemon/table/cs.t.cpp
index a8363de..bcfd3a5 100644
--- a/tests/daemon/table/cs.t.cpp
+++ b/tests/daemon/table/cs.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,
@@ -26,6 +26,7 @@
#include "table/cs.hpp"
#include "tests/test-common.hpp"
+#include "tests/daemon/global-io-fixture.hpp"
#include <cstring>
@@ -33,18 +34,18 @@
#include <ndn-cxx/lp/tags.hpp>
#include <ndn-cxx/util/sha256.hpp>
-#define CHECK_CS_FIND(expected) find([&] (uint32_t found) { BOOST_CHECK_EQUAL(expected, found); });
-
namespace nfd {
namespace cs {
namespace tests {
using namespace nfd::tests;
-BOOST_AUTO_TEST_SUITE(Table)
-BOOST_FIXTURE_TEST_SUITE(TestCs, BaseFixture)
+#define CHECK_CS_FIND(expected) find([&] (uint32_t found) { BOOST_CHECK_EQUAL(expected, found); });
-class FindFixture : public UnitTestTimeFixture
+BOOST_AUTO_TEST_SUITE(Table)
+BOOST_FIXTURE_TEST_SUITE(TestCs, GlobalIoFixture)
+
+class FindFixture : public GlobalIoTimeFixture
{
protected:
Name
diff --git a/tests/daemon/table/dead-nonce-list.t.cpp b/tests/daemon/table/dead-nonce-list.t.cpp
index 1df1070..ea7866c 100644
--- a/tests/daemon/table/dead-nonce-list.t.cpp
+++ b/tests/daemon/table/dead-nonce-list.t.cpp
@@ -27,12 +27,13 @@
#include "daemon/global.hpp"
#include "tests/test-common.hpp"
+#include "tests/daemon/global-io-fixture.hpp"
namespace nfd {
namespace tests {
BOOST_AUTO_TEST_SUITE(Table)
-BOOST_FIXTURE_TEST_SUITE(TestDeadNonceList, BaseFixture)
+BOOST_FIXTURE_TEST_SUITE(TestDeadNonceList, GlobalIoFixture)
BOOST_AUTO_TEST_CASE(Basic)
{
@@ -58,7 +59,7 @@
}
/// A Fixture that periodically inserts Nonces
-class PeriodicalInsertionFixture : public UnitTestTimeFixture
+class PeriodicalInsertionFixture : public GlobalIoTimeFixture
{
protected:
PeriodicalInsertionFixture()
@@ -108,6 +109,7 @@
time::nanoseconds timeUnit;
scheduler::ScopedEventId addNonceEvent;
};
+
const time::nanoseconds PeriodicalInsertionFixture::LIFETIME = time::milliseconds(200);
BOOST_FIXTURE_TEST_CASE(Lifetime, PeriodicalInsertionFixture)
diff --git a/tests/daemon/table/fib.t.cpp b/tests/daemon/table/fib.t.cpp
index 0a6ccff..6e83a95 100644
--- a/tests/daemon/table/fib.t.cpp
+++ b/tests/daemon/table/fib.t.cpp
@@ -26,9 +26,10 @@
#include "table/fib.hpp"
#include "table/pit.hpp"
#include "table/measurements.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
#include "tests/test-common.hpp"
+#include "tests/daemon/global-io-fixture.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
namespace nfd {
namespace fib {
@@ -37,7 +38,7 @@
using namespace nfd::tests;
BOOST_AUTO_TEST_SUITE(Table)
-BOOST_FIXTURE_TEST_SUITE(TestFib, BaseFixture)
+BOOST_FIXTURE_TEST_SUITE(TestFib, GlobalIoFixture)
BOOST_AUTO_TEST_CASE(FibEntry)
{
diff --git a/tests/daemon/table/measurements-accessor.t.cpp b/tests/daemon/table/measurements-accessor.t.cpp
index 86a005a..aeed38f 100644
--- a/tests/daemon/table/measurements-accessor.t.cpp
+++ b/tests/daemon/table/measurements-accessor.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016, 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,
@@ -27,8 +27,9 @@
#include "fw/strategy.hpp"
#include "tests/test-common.hpp"
-#include "../fw/dummy-strategy.hpp"
-#include "../fw/choose-strategy.hpp"
+#include "tests/daemon/global-io-fixture.hpp"
+#include "tests/daemon/fw/dummy-strategy.hpp"
+#include "tests/daemon/fw/choose-strategy.hpp"
namespace nfd {
namespace measurements {
@@ -57,7 +58,7 @@
}
};
-class MeasurementsAccessorFixture : public BaseFixture
+class MeasurementsAccessorFixture : public GlobalIoFixture
{
protected:
MeasurementsAccessorFixture()
diff --git a/tests/daemon/table/measurements.t.cpp b/tests/daemon/table/measurements.t.cpp
index a7e315d..915a049 100644
--- a/tests/daemon/table/measurements.t.cpp
+++ b/tests/daemon/table/measurements.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, 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,
@@ -28,6 +28,7 @@
#include "table/pit.hpp"
#include "tests/test-common.hpp"
+#include "tests/daemon/global-io-fixture.hpp"
namespace nfd {
namespace measurements {
@@ -37,7 +38,7 @@
BOOST_AUTO_TEST_SUITE(Table)
-class MeasurementsFixture : public UnitTestTimeFixture
+class MeasurementsFixture : public GlobalIoTimeFixture
{
public:
MeasurementsFixture()
diff --git a/tests/daemon/table/name-tree.t.cpp b/tests/daemon/table/name-tree.t.cpp
index 458d7e3..4e325bc 100644
--- a/tests/daemon/table/name-tree.t.cpp
+++ b/tests/daemon/table/name-tree.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,
@@ -26,6 +26,7 @@
#include "table/name-tree.hpp"
#include "tests/test-common.hpp"
+#include "tests/daemon/global-io-fixture.hpp"
namespace nfd {
namespace name_tree {
@@ -34,7 +35,7 @@
using namespace nfd::tests;
BOOST_AUTO_TEST_SUITE(Table)
-BOOST_FIXTURE_TEST_SUITE(TestNameTree, BaseFixture)
+BOOST_FIXTURE_TEST_SUITE(TestNameTree, GlobalIoFixture)
BOOST_AUTO_TEST_CASE(ComputeHash)
{
@@ -458,7 +459,7 @@
std::unordered_set<Name> m_names;
};
-class EnumerationFixture : public BaseFixture
+class EnumerationFixture : public GlobalIoFixture
{
protected:
EnumerationFixture()
diff --git a/tests/daemon/table/network-region-table.t.cpp b/tests/daemon/table/network-region-table.t.cpp
index 68f1a03..11948bc 100644
--- a/tests/daemon/table/network-region-table.t.cpp
+++ b/tests/daemon/table/network-region-table.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, 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,
@@ -26,12 +26,13 @@
#include "table/network-region-table.hpp"
#include "tests/test-common.hpp"
+#include "tests/daemon/global-io-fixture.hpp"
namespace nfd {
namespace tests {
BOOST_AUTO_TEST_SUITE(Table)
-BOOST_FIXTURE_TEST_SUITE(TestNetworkRegionTable, BaseFixture)
+BOOST_FIXTURE_TEST_SUITE(TestNetworkRegionTable, GlobalIoFixture)
BOOST_AUTO_TEST_CASE(InProducerRegion)
{
diff --git a/tests/daemon/table/pit-entry.t.cpp b/tests/daemon/table/pit-entry.t.cpp
index d4234ad..a155be2 100644
--- a/tests/daemon/table/pit-entry.t.cpp
+++ b/tests/daemon/table/pit-entry.t.cpp
@@ -24,9 +24,10 @@
*/
#include "table/pit-entry.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
#include "tests/test-common.hpp"
+#include "tests/daemon/global-io-fixture.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
namespace nfd {
namespace pit {
@@ -35,7 +36,7 @@
using namespace nfd::tests;
BOOST_AUTO_TEST_SUITE(Table)
-BOOST_FIXTURE_TEST_SUITE(TestPitEntry, BaseFixture)
+BOOST_FIXTURE_TEST_SUITE(TestPitEntry, GlobalIoFixture)
BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(CanMatch, 1)
BOOST_AUTO_TEST_CASE(CanMatch)
diff --git a/tests/daemon/table/pit.t.cpp b/tests/daemon/table/pit.t.cpp
index 511f2aa..7c6d791 100644
--- a/tests/daemon/table/pit.t.cpp
+++ b/tests/daemon/table/pit.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,
@@ -25,8 +25,9 @@
#include "table/pit.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
#include "tests/test-common.hpp"
+#include "tests/daemon/global-io-fixture.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
#include <ndn-cxx/exclude.hpp>
@@ -37,7 +38,7 @@
using namespace nfd::tests;
BOOST_AUTO_TEST_SUITE(Table)
-BOOST_FIXTURE_TEST_SUITE(TestPit, BaseFixture)
+BOOST_FIXTURE_TEST_SUITE(TestPit, GlobalIoFixture)
BOOST_AUTO_TEST_CASE(Find)
{
diff --git a/tests/daemon/table/strategy-choice.t.cpp b/tests/daemon/table/strategy-choice.t.cpp
index 0173af4..339903e 100644
--- a/tests/daemon/table/strategy-choice.t.cpp
+++ b/tests/daemon/table/strategy-choice.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, 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,
@@ -26,14 +26,13 @@
#include "table/strategy-choice.hpp"
#include "tests/test-common.hpp"
-#include "../fw/dummy-strategy.hpp"
+#include "tests/daemon/global-io-fixture.hpp"
+#include "tests/daemon/fw/dummy-strategy.hpp"
namespace nfd {
namespace tests {
-using fw::Strategy;
-
-class StrategyChoiceFixture : public BaseFixture
+class StrategyChoiceFixture : public GlobalIoFixture
{
protected:
StrategyChoiceFixture()
@@ -66,7 +65,7 @@
bool
isStrategyType(const Name& prefix)
{
- Strategy& effectiveStrategy = sc.findEffectiveStrategy(prefix);
+ auto& effectiveStrategy = sc.findEffectiveStrategy(prefix);
return dynamic_cast<S*>(&effectiveStrategy) != nullptr;
}
diff --git a/tests/daemon/table/strategy-info-host.t.cpp b/tests/daemon/table/strategy-info-host.t.cpp
index 0a3dc2a..2a3a33e 100644
--- a/tests/daemon/table/strategy-info-host.t.cpp
+++ b/tests/daemon/table/strategy-info-host.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016, 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,
@@ -26,6 +26,7 @@
#include "table/strategy-info-host.hpp"
#include "tests/test-common.hpp"
+#include "tests/daemon/global-io-fixture.hpp"
namespace nfd {
namespace tests {
@@ -78,7 +79,7 @@
};
BOOST_AUTO_TEST_SUITE(Table)
-BOOST_FIXTURE_TEST_SUITE(TestStrategyInfoHost, BaseFixture)
+BOOST_FIXTURE_TEST_SUITE(TestStrategyInfoHost, GlobalIoFixture)
BOOST_AUTO_TEST_CASE(Basic)
{