fw: pass parameters to Strategy subclass constructors
refs #3868
Change-Id: I1a09e7353c047d548065c4ed669d1f7993676428
diff --git a/tests/daemon/fw/multicast-strategy.t.cpp b/tests/daemon/fw/multicast-strategy.t.cpp
index b8c3d2f..49bf940 100644
--- a/tests/daemon/fw/multicast-strategy.t.cpp
+++ b/tests/daemon/fw/multicast-strategy.t.cpp
@@ -72,6 +72,18 @@
BOOST_CHECK_EQUAL(Strategy::listRegistered().count(MulticastStrategy::getStrategyName()), 1);
}
+BOOST_AUTO_TEST_CASE(InstanceName)
+{
+ Forwarder forwarder;
+ BOOST_REQUIRE(MulticastStrategy::getStrategyName().at(-1).isVersion());
+ BOOST_CHECK_EQUAL(
+ MulticastStrategy(forwarder, MulticastStrategy::getStrategyName().getPrefix(-1)).getInstanceName(),
+ MulticastStrategy::getStrategyName());
+ BOOST_CHECK_THROW(
+ MulticastStrategy(forwarder, Name(MulticastStrategy::getStrategyName()).append("param")),
+ std::invalid_argument);
+}
+
BOOST_AUTO_TEST_CASE(Forward2)
{
fib::Entry& fibEntry = *fib.insert(Name()).first;