28 #include "ns3/aodv-id-cache.h"
44 virtual void DoRun ();
45 void CheckTimeout1 ();
46 void CheckTimeout2 ();
47 void CheckTimeout3 ();
66 NS_TEST_EXPECT_MSG_EQ (cache.
GetSize (), 6,
"trivial");
76 IdCacheTest::CheckTimeout1 ()
78 NS_TEST_EXPECT_MSG_EQ (cache.
GetSize (), 6,
"Nothing expire");
82 IdCacheTest::CheckTimeout2 ()
84 NS_TEST_EXPECT_MSG_EQ (cache.
GetSize (), 3,
"3 records left");
88 IdCacheTest::CheckTimeout3 ()
90 NS_TEST_EXPECT_MSG_EQ (cache.
GetSize (), 0,
"All records expire");
100 } g_idCacheTestSuite;
Unique packets identification cache used for simple duplicate detection.
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
TestSuite(std::string name, Type type=UNIT)
Constuct a new test suite.
TestCase(std::string name)
static void Destroy(void)
uint32_t GetSize()
Return number of entries in cache.
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual test case to this test suite.
Time GetLifeTime() const
Return lifetime for existing entries in cache.
void SetLifetime(Time lifetime)
Set lifetime for future added entries.
Ipv4 addresses are stored in host order in this class.
Time Seconds(double seconds)
create ns3::Time instances in units of seconds.
bool IsDuplicate(Ipv4Address addr, uint32_t id)
Check that entry (addr, id) exists in cache. Add entry, if it doesn't exist.
virtual void DoRun()
Implementation to actually run this test case.