fw: pass parameters to Strategy subclass constructors
refs #3868
Change-Id: I1a09e7353c047d548065c4ed669d1f7993676428
diff --git a/tests/daemon/fw/best-route-strategy2.t.cpp b/tests/daemon/fw/best-route-strategy2.t.cpp
index 29de094..6a1848e 100644
--- a/tests/daemon/fw/best-route-strategy2.t.cpp
+++ b/tests/daemon/fw/best-route-strategy2.t.cpp
@@ -81,6 +81,18 @@
BOOST_CHECK_EQUAL(Strategy::listRegistered().count(BestRouteStrategy2::getStrategyName()), 1);
}
+BOOST_AUTO_TEST_CASE(InstanceName)
+{
+ Forwarder forwarder;
+ BOOST_REQUIRE(BestRouteStrategy2::getStrategyName().at(-1).isVersion());
+ BOOST_CHECK_EQUAL(
+ BestRouteStrategy2(forwarder, BestRouteStrategy2::getStrategyName().getPrefix(-1)).getInstanceName(),
+ BestRouteStrategy2::getStrategyName());
+ BOOST_CHECK_THROW(
+ BestRouteStrategy2(forwarder, Name(BestRouteStrategy2::getStrategyName()).append("param")),
+ std::invalid_argument);
+}
+
BOOST_AUTO_TEST_CASE(Forward)
{
fib::Entry& fibEntry = *fib.insert(Name()).first;