security: Add general interface to chain validation policies
Change-Id: I1a0d47aeb847455a2d7d6d48185f6edd9024d298
Refs: #3920
diff --git a/tests/unit-tests/security/v2/validator.t.cpp b/tests/unit-tests/security/v2/validator.t.cpp
index 73bd23d..42bcf2a 100644
--- a/tests/unit-tests/security/v2/validator.t.cpp
+++ b/tests/unit-tests/security/v2/validator.t.cpp
@@ -36,6 +36,19 @@
BOOST_AUTO_TEST_SUITE(V2)
BOOST_FIXTURE_TEST_SUITE(TestValidator, HierarchicalValidatorFixture<ValidationPolicySimpleHierarchy>)
+BOOST_AUTO_TEST_CASE(ConstructorSetValidator)
+{
+ auto middlePolicy = make_unique<ValidationPolicySimpleHierarchy>();
+ auto innerPolicy = make_unique<ValidationPolicySimpleHierarchy>();
+
+ validator.getPolicy().setInnerPolicy(std::move(middlePolicy));
+ validator.getPolicy().setInnerPolicy(std::move(innerPolicy));
+
+ BOOST_CHECK(validator.getPolicy().m_validator != nullptr);
+ BOOST_CHECK(validator.getPolicy().getInnerPolicy().m_validator != nullptr);
+ BOOST_CHECK(validator.getPolicy().getInnerPolicy().getInnerPolicy().m_validator != nullptr);
+}
+
BOOST_AUTO_TEST_CASE(Timeouts)
{
processInterest = nullptr; // no response for all interests