fw: pass parameters to Strategy subclass constructors
refs #3868
Change-Id: I1a09e7353c047d548065c4ed669d1f7993676428
diff --git a/tests/daemon/fw/asf-strategy.t.cpp b/tests/daemon/fw/asf-strategy.t.cpp
index 97f7da7..c370cbd 100644
--- a/tests/daemon/fw/asf-strategy.t.cpp
+++ b/tests/daemon/fw/asf-strategy.t.cpp
@@ -48,6 +48,18 @@
BOOST_CHECK_EQUAL(Strategy::listRegistered().count(AsfStrategy::getStrategyName()), 1);
}
+BOOST_AUTO_TEST_CASE(InstanceName)
+{
+ Forwarder forwarder;
+ BOOST_REQUIRE(AsfStrategy::getStrategyName().at(-1).isVersion());
+ BOOST_CHECK_EQUAL(
+ AsfStrategy(forwarder, AsfStrategy::getStrategyName().getPrefix(-1)).getInstanceName(),
+ AsfStrategy::getStrategyName());
+ BOOST_CHECK_THROW(
+ AsfStrategy(forwarder, Name(AsfStrategy::getStrategyName()).append("param")),
+ std::invalid_argument);
+}
+
class AsfGridFixture : public UnitTestTimeFixture
{
protected: