LrWpan ACK Test. More...
Public Types | |
enum | TestMode_e { EXTENDED_ADDRESS_UNICAST , SHORT_ADDRESS_UNICAST , SHORT_ADDRESS_MULTICAST , SHORT_ADDRESS_BROADCAST } |
Test modes. More... | |
Public Types inherited from ns3::TestCase | |
enum | TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
Public Member Functions | |
LrWpanAckTestCase (const char *const prefix, TestMode_e mode) | |
Create test case. More... | |
void | DataConfirmDev0 (McpsDataConfirmParams params) |
Function called when DataConfirm is hit on dev0. More... | |
void | DataConfirmDev1 (McpsDataConfirmParams params) |
Function called when DataConfirm is hit on dev1. More... | |
void | DataIndicationDev0 (McpsDataIndicationParams params, Ptr< Packet > p) |
Function called when DataIndication is hit on dev0. More... | |
void | DataIndicationDev1 (McpsDataIndicationParams params, Ptr< Packet > p) |
Function called when DataIndication is hit on dev1. More... | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName (void) const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
virtual void | DoRun (void) |
Implementation to actually run this TestCase. More... | |
Private Attributes | |
Ptr< LrWpanNetDevice > | m_dev0 |
1st LrWpanNetDevice. More... | |
Ptr< LrWpanNetDevice > | m_dev1 |
2nd LrWpanNetDevice. More... | |
TestMode_e | m_mode |
Test mode. More... | |
std::string | m_prefix |
Filename prefix. More... | |
Time | m_replyArrivalTime |
Reply arrival time. More... | |
Time | m_replySentTime |
Reply successfully sent time. More... | |
Time | m_replyTime |
Reply time. More... | |
Time | m_requestSentTime |
Request successfully sent time. More... | |
Time | m_requestTime |
Request time. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from ns3::TestCase | |
TestCase (std::string name) | |
Constructor. More... | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. More... | |
TestCase * | GetParent () const |
Get the parent of this TestCsse. More... | |
bool | IsStatusFailure (void) const |
Check if any tests failed. More... | |
bool | IsStatusSuccess (void) const |
Check if all tests passed. More... | |
void | SetDataDir (std::string directory) |
Set the data directory where reference trace files can be found. More... | |
void | ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line) |
Log the failure of this TestCase. More... | |
bool | MustAssertOnFailure (void) const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure (void) const |
Check if this run should continue on failure. More... | |
std::string | CreateDataDirFilename (std::string filename) |
Construct the full path to a file in the data directory. More... | |
std::string | CreateTempDirFilename (std::string filename) |
Construct the full path to a file in a temporary directory. More... | |
LrWpan ACK Test.
Definition at line 55 of file lr-wpan-ack-test.cc.
Test modes.
Definition at line 62 of file lr-wpan-ack-test.cc.
LrWpanAckTestCase::LrWpanAckTestCase | ( | const char *const | prefix, |
TestMode_e | mode | ||
) |
Create test case.
prefix | Unique file names prefix |
mode | Test mode |
Definition at line 115 of file lr-wpan-ack-test.cc.
References m_mode, m_prefix, m_replyArrivalTime, m_replySentTime, m_replyTime, m_requestSentTime, m_requestTime, and ns3::Seconds().
void LrWpanAckTestCase::DataConfirmDev0 | ( | McpsDataConfirmParams | params | ) |
Function called when DataConfirm is hit on dev0.
params | The MCPS params. |
Definition at line 159 of file lr-wpan-ack-test.cc.
References m_requestSentTime, and ns3::Now().
Referenced by DoRun().
void LrWpanAckTestCase::DataConfirmDev1 | ( | McpsDataConfirmParams | params | ) |
Function called when DataConfirm is hit on dev1.
params | The MCPS params. |
Definition at line 165 of file lr-wpan-ack-test.cc.
References m_replySentTime, and ns3::Now().
Referenced by DoRun().
void LrWpanAckTestCase::DataIndicationDev0 | ( | McpsDataIndicationParams | params, |
Ptr< Packet > | p | ||
) |
Function called when DataIndication is hit on dev0.
params | The MCPS params. |
p | the packet. |
Definition at line 128 of file lr-wpan-ack-test.cc.
References m_replyArrivalTime, and ns3::Now().
Referenced by DoRun().
void LrWpanAckTestCase::DataIndicationDev1 | ( | McpsDataIndicationParams | params, |
Ptr< Packet > | p | ||
) |
Function called when DataIndication is hit on dev1.
params | The MCPS params. |
p | the packet. |
Definition at line 134 of file lr-wpan-ack-test.cc.
References ns3::EXT_ADDR, EXTENDED_ADDRESS_UNICAST, ns3::LrWpanNetDevice::GetMac(), m_dev1, ns3::McpsDataRequestParams::m_dstAddr, ns3::McpsDataRequestParams::m_dstAddrMode, ns3::McpsDataRequestParams::m_dstExtAddr, ns3::McpsDataRequestParams::m_dstPanId, m_mode, ns3::McpsDataRequestParams::m_msduHandle, m_replyTime, ns3::McpsDataRequestParams::m_srcAddrMode, ns3::McpsDataRequestParams::m_txOptions, ns3::Now(), ns3::SHORT_ADDR, and ns3::TX_OPTION_NONE.
Referenced by DoRun().
|
privatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 171 of file lr-wpan-ack-test.cc.
References ns3::Node::AddDevice(), ns3::LrWpanNetDevice::AssignStreams(), third::channel, ns3::TestCase::CreateTempDirFilename(), DataConfirmDev0(), DataConfirmDev1(), DataIndicationDev0(), DataIndicationDev1(), ns3::AsciiTraceHelperForDevice::EnableAscii(), ns3::EXT_ADDR, EXTENDED_ADDRESS_UNICAST, ns3::LrWpanNetDevice::GetMac(), ns3::LrWpanNetDevice::GetPhy(), m_dev0, m_dev1, ns3::McpsDataRequestParams::m_dstAddr, ns3::McpsDataRequestParams::m_dstAddrMode, ns3::McpsDataRequestParams::m_dstExtAddr, ns3::McpsDataRequestParams::m_dstPanId, m_mode, ns3::McpsDataRequestParams::m_msduHandle, m_prefix, m_replyArrivalTime, m_replySentTime, m_replyTime, m_requestSentTime, m_requestTime, ns3::McpsDataRequestParams::m_srcAddrMode, ns3::McpsDataRequestParams::m_txOptions, ns3::MakeCallback(), ns3::Now(), NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_GT, NS_TEST_EXPECT_MSG_LT, ns3::LrWpanNetDevice::SetAddress(), ns3::LrWpanNetDevice::SetChannel(), ns3::SHORT_ADDR, SHORT_ADDRESS_BROADCAST, SHORT_ADDRESS_MULTICAST, SHORT_ADDRESS_UNICAST, and ns3::TX_OPTION_ACK.
|
private |
|
private |
2nd LrWpanNetDevice.
Definition at line 112 of file lr-wpan-ack-test.cc.
Referenced by DataIndicationDev1(), and DoRun().
|
private |
Test mode.
Definition at line 110 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), DataIndicationDev1(), and DoRun().
|
private |
Filename prefix.
Definition at line 104 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), and DoRun().
|
private |
Reply arrival time.
Definition at line 109 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), DataIndicationDev0(), and DoRun().
|
private |
Reply successfully sent time.
Definition at line 108 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), DataConfirmDev1(), and DoRun().
|
private |
Reply time.
Definition at line 107 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), DataIndicationDev1(), and DoRun().
|
private |
Request successfully sent time.
Definition at line 106 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), DataConfirmDev0(), and DoRun().
|
private |
Request time.
Definition at line 105 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), and DoRun().