table: ContentStore recognizes CachingPolicy-NoCache
refs #2185
Change-Id: Id3dab8936c4dafc96c5d8933d7e75c6cc2e31ff2
diff --git a/tests/daemon/table/cs.t.cpp b/tests/daemon/table/cs.t.cpp
index 6d69eda..43c65af 100644
--- a/tests/daemon/table/cs.t.cpp
+++ b/tests/daemon/table/cs.t.cpp
@@ -33,6 +33,7 @@
namespace tests {
using namespace nfd::tests;
+using ndn::nfd::LocalControlHeader;
BOOST_FIXTURE_TEST_SUITE(TableCs, BaseFixture)
@@ -315,6 +316,18 @@
BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_CASE(CachingPolicyNoCache)
+{
+ Cs cs(3);
+
+ shared_ptr<Data> dataA = makeData("ndn:/A");
+ dataA->getLocalControlHeader().setCachingPolicy(LocalControlHeader::CachingPolicy::NO_CACHE);
+ dataA->wireEncode();
+ BOOST_CHECK_EQUAL(cs.insert(*dataA), false);
+
+ BOOST_CHECK(cs.find(Interest("ndn:/A")) == nullptr);
+}
+
BOOST_FIXTURE_TEST_CASE(Evict, UnitTestTimeFixture)
{
Cs cs(3);