RREP_ACK unit test

This commit is contained in:
Borovkova Elena
2009-07-06 22:58:31 +04:00
parent 736fbc07e6
commit 6a32ee2209

View File

@@ -379,5 +379,30 @@ std::ostream & operator<<(std::ostream & os, RrepAckHader const & h)
return os;
}
#ifdef RUN_SELF_TESTS
/// Unit test for RREP-ACK
struct RrepAckHeaderTest : public Test
{
RrepAckHeaderTest () : Test ("AODV/RREP-ACK") {}
virtual bool RunTests();
};
/// Test instance
static RrepAckHeaderTest g_RrepAckHeaderTest;
bool RrepAckHeaderTest::RunTests ()
{
bool result(true);
RrepAckHader h;
Ptr<Packet> p = Create<Packet> ();
p->AddHeader (h);
RrepAckHader h2;
uint32_t bytes = p->RemoveHeader(h2);
NS_TEST_ASSERT_EQUAL (bytes, 2);
NS_TEST_ASSERT_EQUAL (h, h2);
return result;
}
#endif
}}