fw: rename BestRouteStrategy2 class to BestRouteStrategy
Also rename ad-hoc-forwarding.t.cpp to strategy-ad-hoc-face.t.cpp
and broadcast-medium.t.cpp to strategy-broadcast-medium.t.cpp,
for consistency with the other strategy-*.t.cpp test suites.
Change-Id: Ia8f5257260563732d74c7d58e35481b73a231f06
diff --git a/tests/daemon/fw/best-route-strategy2.t.cpp b/tests/daemon/fw/best-route-strategy.t.cpp
similarity index 86%
rename from tests/daemon/fw/best-route-strategy2.t.cpp
rename to tests/daemon/fw/best-route-strategy.t.cpp
index fa9d883..cd519b5 100644
--- a/tests/daemon/fw/best-route-strategy2.t.cpp
+++ b/tests/daemon/fw/best-route-strategy.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-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -23,7 +23,7 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "fw/best-route-strategy2.hpp"
+#include "fw/best-route-strategy.hpp"
#include "common/global.hpp"
#include "tests/test-common.hpp"
@@ -34,15 +34,15 @@
namespace fw {
namespace tests {
-using BestRouteStrategy2Tester = StrategyTester<BestRouteStrategy2>;
-NFD_REGISTER_STRATEGY(BestRouteStrategy2Tester);
+using BestRouteStrategyTester = StrategyTester<BestRouteStrategy>;
+NFD_REGISTER_STRATEGY(BestRouteStrategyTester);
BOOST_AUTO_TEST_SUITE(Fw)
-class BestRouteStrategy2Fixture : public GlobalIoTimeFixture
+class BestRouteStrategyFixture : public GlobalIoTimeFixture
{
protected:
- BestRouteStrategy2Fixture()
+ BestRouteStrategyFixture()
: face1(make_shared<DummyFace>())
, face2(make_shared<DummyFace>())
, face3(make_shared<DummyFace>())
@@ -59,7 +59,7 @@
protected:
FaceTable faceTable;
Forwarder forwarder{faceTable};
- BestRouteStrategy2Tester strategy{forwarder};
+ BestRouteStrategyTester strategy{forwarder};
Fib& fib{forwarder.getFib()};
Pit& pit{forwarder.getPit()};
@@ -70,7 +70,7 @@
shared_ptr<DummyFace> face5;
};
-BOOST_FIXTURE_TEST_SUITE(TestBestRouteStrategy2, BestRouteStrategy2Fixture)
+BOOST_FIXTURE_TEST_SUITE(TestBestRouteStrategy, BestRouteStrategyFixture)
BOOST_AUTO_TEST_CASE(Forward)
{
@@ -82,8 +82,8 @@
shared_ptr<Interest> interest = makeInterest("ndn:/BzgFBchqA");
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
- const time::nanoseconds TICK = time::duration_cast<time::nanoseconds>(
- BestRouteStrategy2::RETX_SUPPRESSION_INITIAL * 0.1);
+ const auto TICK = time::duration_cast<time::nanoseconds>(
+ BestRouteStrategy::RETX_SUPPRESSION_INITIAL * 0.1);
// first Interest goes to nexthop with lowest FIB cost,
// however face1 is downstream so it cannot be used
@@ -114,7 +114,7 @@
retxFrom4Evt = getScheduler().schedule(TICK * 5, periodicalRetxFrom4);
};
periodicalRetxFrom4();
- this->advanceClocks(TICK, BestRouteStrategy2::RETX_SUPPRESSION_MAX * 16);
+ this->advanceClocks(TICK, BestRouteStrategy::RETX_SUPPRESSION_MAX * 16);
retxFrom4Evt.cancel();
// nexthops for accepted retransmissions: follow FIB cost,
@@ -130,7 +130,7 @@
strategy.sendInterestHistory.clear();
for (int i = 0; i < 3; ++i) {
- this->advanceClocks(TICK, BestRouteStrategy2::RETX_SUPPRESSION_MAX * 2);
+ this->advanceClocks(TICK, BestRouteStrategy::RETX_SUPPRESSION_MAX * 2);
pitEntry->insertOrUpdateInRecord(*face5, *interest);
strategy.afterReceiveInterest(FaceEndpoint(*face5, 0), *interest, pitEntry);
}
@@ -141,7 +141,7 @@
// face1 cannot be used because it's gone from FIB entry
}
-BOOST_AUTO_TEST_SUITE_END() // TestBestRouteStrategy2
+BOOST_AUTO_TEST_SUITE_END() // TestBestRouteStrategy
BOOST_AUTO_TEST_SUITE_END() // Fw
} // namespace tests
diff --git a/tests/daemon/fw/forwarding-hint.t.cpp b/tests/daemon/fw/forwarding-hint.t.cpp
index 7e9dbdc..fe3e51c 100644
--- a/tests/daemon/fw/forwarding-hint.t.cpp
+++ b/tests/daemon/fw/forwarding-hint.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-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -23,7 +23,7 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "fw/best-route-strategy2.hpp"
+#include "fw/best-route-strategy.hpp"
#include "tests/daemon/global-io-fixture.hpp"
#include "topology-tester.hpp"
@@ -67,8 +67,8 @@
nodeC = topo.addForwarder("click");
nodeS = topo.addForwarder("spurs");
nodeQ = topo.addForwarder("serverQ");
- for (TopologyNode node : {nodeA, nodeH, nodeT, nodeP, nodeC, nodeS, nodeQ}) {
- topo.setStrategy<BestRouteStrategy2>(node);
+ for (auto node : {nodeA, nodeH, nodeT, nodeP, nodeC, nodeS, nodeQ}) {
+ topo.setStrategy<BestRouteStrategy>(node);
}
topo.getForwarder(nodeH).getNetworkRegionTable().insert("/arizona/cs/hobo");
diff --git a/tests/daemon/fw/ad-hoc-forwarding.t.cpp b/tests/daemon/fw/strategy-ad-hoc-face.t.cpp
similarity index 90%
rename from tests/daemon/fw/ad-hoc-forwarding.t.cpp
rename to tests/daemon/fw/strategy-ad-hoc-face.t.cpp
index da696a0..bdf0cb6 100644
--- a/tests/daemon/fw/ad-hoc-forwarding.t.cpp
+++ b/tests/daemon/fw/strategy-ad-hoc-face.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-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,7 +30,7 @@
// Strategies that can forward Interest to an ad hoc face even if it's the downstream,
// sorted alphabetically.
#include "fw/asf-strategy.hpp"
-#include "fw/best-route-strategy2.hpp"
+#include "fw/best-route-strategy.hpp"
#include "fw/multicast-strategy.hpp"
#include "fw/random-strategy.hpp"
@@ -44,10 +44,10 @@
namespace tests {
template<typename S>
-class AdHocForwardingFixture : public GlobalIoTimeFixture
+class AdHocTopologyFixture : public GlobalIoTimeFixture
{
protected:
- AdHocForwardingFixture()
+ AdHocTopologyFixture()
{
nodeA = topo.addForwarder("A");
nodeB = topo.addForwarder("B");
@@ -84,17 +84,17 @@
};
BOOST_AUTO_TEST_SUITE(Fw)
-BOOST_AUTO_TEST_SUITE(TestAdHocForwarding)
+BOOST_AUTO_TEST_SUITE(TestStrategyAdHocFace)
using Strategies = boost::mpl::vector<
AsfStrategy,
- BestRouteStrategy2,
+ BestRouteStrategy,
MulticastStrategy,
RandomStrategy
>;
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(SingleNexthop, S, Strategies,
- AdHocForwardingFixture<S>)
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(SingleNexthop,
+ S, Strategies, AdHocTopologyFixture<S>)
{
// +---+---+
// A B C
@@ -115,8 +115,8 @@
BOOST_CHECK_EQUAL(this->appA->getForwarderFace().getCounters().nOutData, 10);
}
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(SecondNexthop, S, Strategies,
- AdHocForwardingFixture<S>)
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(SecondNexthop,
+ S, Strategies, AdHocTopologyFixture<S>)
{
// +---+---+
// A B C
@@ -148,7 +148,7 @@
BOOST_CHECK_GE(this->appA->getForwarderFace().getCounters().nOutData, 25);
}
-BOOST_AUTO_TEST_SUITE_END() // TestAdHocForwarding
+BOOST_AUTO_TEST_SUITE_END() // TestStrategyAdHocFace
BOOST_AUTO_TEST_SUITE_END() // Fw
} // namespace tests
diff --git a/tests/daemon/fw/broadcast-medium.t.cpp b/tests/daemon/fw/strategy-broadcast-medium.t.cpp
similarity index 88%
rename from tests/daemon/fw/broadcast-medium.t.cpp
rename to tests/daemon/fw/strategy-broadcast-medium.t.cpp
index da02718..6a45b2e 100644
--- a/tests/daemon/fw/broadcast-medium.t.cpp
+++ b/tests/daemon/fw/strategy-broadcast-medium.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-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -23,10 +23,15 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
+/** \file
+ * This test suite checks that a strategy can correctly handle a multi-access face
+ * on a broadcast medium.
+ */
+
// Strategies that can correctly handle multi-access faces on a broadcast medium,
// sorted alphabetically.
#include "fw/asf-strategy.hpp"
-#include "fw/best-route-strategy2.hpp"
+#include "fw/best-route-strategy.hpp"
#include "fw/multicast-strategy.hpp"
#include "fw/random-strategy.hpp"
@@ -82,16 +87,17 @@
};
BOOST_AUTO_TEST_SUITE(Fw)
-BOOST_AUTO_TEST_SUITE(TestBroadcastMedium)
+BOOST_AUTO_TEST_SUITE(TestStrategyBroadcastMedium)
using Strategies = boost::mpl::vector<
AsfStrategy,
- BestRouteStrategy2,
+ BestRouteStrategy,
MulticastStrategy,
RandomStrategy
>;
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(SameFaceDifferentEndpoint, S, Strategies, BroadcastMediumFixture<S>)
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(SameFaceDifferentEndpoint,
+ S, Strategies, BroadcastMediumFixture<S>)
{
// C D P
// | | |
@@ -116,7 +122,7 @@
BOOST_CHECK_EQUAL(this->faceP->getCounters().nOutData, 1);
}
-BOOST_AUTO_TEST_SUITE_END() // TestBroadcastMedium
+BOOST_AUTO_TEST_SUITE_END() // TestStrategyBroadcastMedium
BOOST_AUTO_TEST_SUITE_END() // Fw
} // namespace tests
diff --git a/tests/daemon/fw/strategy-instantiation.t.cpp b/tests/daemon/fw/strategy-instantiation.t.cpp
index 6bbcebb..4b319cb 100644
--- a/tests/daemon/fw/strategy-instantiation.t.cpp
+++ b/tests/daemon/fw/strategy-instantiation.t.cpp
@@ -30,7 +30,7 @@
// All strategies, sorted alphabetically.
#include "fw/access-strategy.hpp"
#include "fw/asf-strategy.hpp"
-#include "fw/best-route-strategy2.hpp"
+#include "fw/best-route-strategy.hpp"
#include "fw/multicast-strategy.hpp"
#include "fw/self-learning-strategy.hpp"
#include "fw/random-strategy.hpp"
@@ -74,7 +74,7 @@
using Tests = boost::mpl::vector<
Test<AccessStrategy, false, 1>,
Test<AsfStrategy, true, 3>,
- Test<BestRouteStrategy2, false, 5>,
+ Test<BestRouteStrategy, false, 5>,
Test<MulticastStrategy, false, 4>,
Test<SelfLearningStrategy, false, 1>,
Test<RandomStrategy, false, 1>
diff --git a/tests/daemon/fw/strategy-nack-return.t.cpp b/tests/daemon/fw/strategy-nack-return.t.cpp
index a370685..5811652 100644
--- a/tests/daemon/fw/strategy-nack-return.t.cpp
+++ b/tests/daemon/fw/strategy-nack-return.t.cpp
@@ -28,10 +28,9 @@
*/
// Strategies implementing recommended Nack processing procedure, sorted alphabetically.
-#include "fw/best-route-strategy2.hpp"
+#include "fw/best-route-strategy.hpp"
#include "fw/random-strategy.hpp"
-#include "choose-strategy.hpp"
#include "strategy-tester.hpp"
#include "topology-tester.hpp"
#include "tests/daemon/face/dummy-face.hpp"
@@ -42,8 +41,6 @@
namespace fw {
namespace tests {
-BOOST_AUTO_TEST_SUITE(Fw)
-
template<typename S>
class StrategyNackReturnFixture : public GlobalIoTimeFixture
{
@@ -83,10 +80,11 @@
shared_ptr<Face> face5;
};
+BOOST_AUTO_TEST_SUITE(Fw)
BOOST_AUTO_TEST_SUITE(TestStrategyNackReturn)
using Strategies = boost::mpl::vector<
- BestRouteStrategy2,
+ BestRouteStrategy,
RandomStrategy
>;
@@ -138,7 +136,7 @@
this->fib.addOrUpdateNextHop(fibEntry, *this->face4, 20);
this->fib.addOrUpdateNextHop(fibEntry, *this->face5, 30);
- auto interest1 = makeInterest("/aS9FAyUV19", 286);
+ auto interest1 = makeInterest("/aS9FAyUV19", false, nullopt, 286);
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest1).first;
pitEntry->insertOrUpdateInRecord(*this->face1, *interest1);
pitEntry->insertOrUpdateOutRecord(*this->face3, *interest1);
@@ -317,9 +315,10 @@
NackReasonCombination<lp::NackReason::NONE, lp::NackReason::NONE, lp::NackReason::NONE>
>;
-// use BestRouteStrategy2 as a representative to test Nack reason combination
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(CombineReasons, Combination, NackReasonCombinations,
- StrategyNackReturnFixture<BestRouteStrategy2>)
+// use BestRouteStrategy as a representative to test Nack reason combination
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(CombineReasons,
+ Combination, NackReasonCombinations,
+ StrategyNackReturnFixture<BestRouteStrategy>)
{
fib::Entry& fibEntry = *fib.insert(Name()).first;
fib.addOrUpdateNextHop(fibEntry, *face3, 10);
diff --git a/tests/daemon/fw/strategy-no-route.t.cpp b/tests/daemon/fw/strategy-no-route.t.cpp
index c5a4f89..93a6367 100644
--- a/tests/daemon/fw/strategy-no-route.t.cpp
+++ b/tests/daemon/fw/strategy-no-route.t.cpp
@@ -31,7 +31,7 @@
// Strategies returning Nack-NoRoute when there are no usable FIB nexthops,
// sorted alphabetically.
#include "fw/asf-strategy.hpp"
-#include "fw/best-route-strategy2.hpp"
+#include "fw/best-route-strategy.hpp"
#include "fw/random-strategy.hpp"
#include "tests/test-common.hpp"
@@ -145,9 +145,9 @@
Test<AsfStrategy, NextHopIsDownstream<AsfStrategy>>,
Test<AsfStrategy, NextHopViolatesScope<AsfStrategy>>,
- Test<BestRouteStrategy2, EmptyNextHopList<BestRouteStrategy2>>,
- Test<BestRouteStrategy2, NextHopIsDownstream<BestRouteStrategy2>>,
- Test<BestRouteStrategy2, NextHopViolatesScope<BestRouteStrategy2>>,
+ Test<BestRouteStrategy, EmptyNextHopList<BestRouteStrategy>>,
+ Test<BestRouteStrategy, NextHopIsDownstream<BestRouteStrategy>>,
+ Test<BestRouteStrategy, NextHopViolatesScope<BestRouteStrategy>>,
Test<RandomStrategy, EmptyNextHopList<RandomStrategy>>,
Test<RandomStrategy, NextHopIsDownstream<RandomStrategy>>,
diff --git a/tests/daemon/fw/strategy-scope-control.t.cpp b/tests/daemon/fw/strategy-scope-control.t.cpp
index 7b0a271..5c6c552 100644
--- a/tests/daemon/fw/strategy-scope-control.t.cpp
+++ b/tests/daemon/fw/strategy-scope-control.t.cpp
@@ -30,7 +30,7 @@
// Strategies implementing namespace-based scope control, sorted alphabetically.
#include "fw/access-strategy.hpp"
#include "fw/asf-strategy.hpp"
-#include "fw/best-route-strategy2.hpp"
+#include "fw/best-route-strategy.hpp"
#include "fw/multicast-strategy.hpp"
#include "fw/random-strategy.hpp"
@@ -112,7 +112,7 @@
using Tests = boost::mpl::vector<
Test<AccessStrategy, false, false, true>,
Test<AsfStrategy, true, false, true>,
- Test<BestRouteStrategy2, true, true, true>,
+ Test<BestRouteStrategy, true, true, true>,
Test<MulticastStrategy, false, false, false>,
Test<RandomStrategy, true, true, true>
>;