table: erase NameTree entry when FIB/Measurements/StrategyChoice entry is erased
This commit also optimizes Measurements table to make use of NameTree shortcuts.
refs #1803
Change-Id: Ib0e465750ed5e8ff9ed129a926a7bc852db4e9e1
diff --git a/tests/daemon/table/pit.cpp b/tests/daemon/table/pit.cpp
index 52013a6..566421f 100644
--- a/tests/daemon/table/pit.cpp
+++ b/tests/daemon/table/pit.cpp
@@ -352,6 +352,18 @@
}
+BOOST_AUTO_TEST_CASE(EraseNameTreeEntry)
+{
+ NameTree nameTree;
+ Pit pit(nameTree);
+ size_t nNameTreeEntriesBefore = nameTree.size();
+
+ shared_ptr<Interest> interest = makeInterest("/37xWVvQ2K");
+ shared_ptr<pit::Entry> entry = pit.insert(*interest).first;
+ pit.erase(entry);
+ BOOST_CHECK_EQUAL(nameTree.size(), nNameTreeEntriesBefore);
+}
+
BOOST_AUTO_TEST_CASE(FindAllDataMatches)
{
Name nameA ("ndn:/A");