table: Pit::erase accepts Entry* instead of shared_ptr
refs #3164
Change-Id: I9ff47c80865da42b09870c632707dffd78ed76b9
diff --git a/tests/daemon/table/name-tree.t.cpp b/tests/daemon/table/name-tree.t.cpp
index a839152..127056d 100644
--- a/tests/daemon/table/name-tree.t.cpp
+++ b/tests/daemon/table/name-tree.t.cpp
@@ -249,11 +249,15 @@
npe.insertPitEntry(pit2);
BOOST_CHECK_EQUAL(npe.getPitEntries().size(), 2);
- npe.erasePitEntry(pit1);
+ pit::Entry* pit1ptr = pit1.get();
+ weak_ptr<pit::Entry> pit1weak(pit1);
+ pit1.reset();
+ BOOST_CHECK_EQUAL(pit1weak.use_count(), 1); // npe is the sole owner of pit1
+ npe.erasePitEntry(pit1ptr);
BOOST_REQUIRE_EQUAL(npe.getPitEntries().size(), 1);
BOOST_CHECK_EQUAL(npe.getPitEntries().front()->getInterest(), *interest2);
- npe.erasePitEntry(pit2);
+ npe.erasePitEntry(pit2.get());
BOOST_CHECK_EQUAL(npe.hasPitEntries(), false);
BOOST_CHECK_EQUAL(npe.getPitEntries().size(), 0);
BOOST_CHECK_EQUAL(npe.hasTableEntries(), false);