Introducing a couple of real test cases.
Also, basic PIT test shows that everything works as expected...
There was one big change in PIT. Previously, when PIT entry was
satisfied, it was immediately removed. As of recently, PIT entry is
immediately removed.
diff --git a/model/ccnx-pit-impl.cc b/model/ccnx-pit-impl.cc
index 0dcfef2..f68f9dd 100644
--- a/model/ccnx-pit-impl.cc
+++ b/model/ccnx-pit-impl.cc
@@ -110,9 +110,18 @@
{
m_cleanEvent.Cancel ();
if (i_time.empty ())
- return;
+ {
+ NS_LOG_DEBUG ("No items in PIT");
+ return;
+ }
- m_cleanEvent = Simulator::Schedule (i_time.begin ()->GetExpireTime (),
+ Time nextEvent = i_time.begin ()->GetExpireTime () - Simulator::Now ();
+ if (nextEvent < 0) nextEvent = Seconds (0);
+
+ NS_LOG_DEBUG ("Schedule next cleaning in " <<
+ nextEvent.ToDouble (Time::S) << "s (at " <<
+ i_time.begin ()->GetExpireTime () << "s abs time");
+ m_cleanEvent = Simulator::Schedule (nextEvent,
&CcnxPitImpl::CleanExpired, this);
}
@@ -217,6 +226,12 @@
}
}
+uint32_t
+CcnxPitImpl::GetSize () const
+{
+ return super::getPolicy ().size ();
+}
+
Ptr<CcnxPitEntry>
CcnxPitImpl::Begin ()
{