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. | |
void | DataConfirmDev0 (McpsDataConfirmParams params) |
Function called when DataConfirm is hit on dev0. | |
void | DataConfirmDev1 (McpsDataConfirmParams params) |
Function called when DataConfirm is hit on dev1. | |
void | DataIndicationDev0 (McpsDataIndicationParams params, Ptr< Packet > p) |
Function called when DataIndication is hit on dev0. | |
void | DataIndicationDev1 (McpsDataIndicationParams params, Ptr< Packet > p) |
Function called when DataIndication is hit on dev1. | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | DoRun () override |
Implementation to actually run this TestCase. | |
Private Attributes | |
Ptr< LrWpanNetDevice > | m_dev0 |
1st LrWpanNetDevice. | |
Ptr< LrWpanNetDevice > | m_dev1 |
2nd LrWpanNetDevice. | |
TestMode_e | m_mode |
Test mode. | |
std::string | m_prefix |
Filename prefix. | |
Time | m_replyArrivalTime |
Reply arrival time. | |
Time | m_replySentTime |
Reply successfully sent time. | |
Time | m_replyTime |
Reply time. | |
Time | m_requestSentTime |
Request successfully sent time. | |
Time | m_requestTime |
Request time. | |
Additional Inherited Members | |
Protected Member Functions inherited from ns3::TestCase | |
TestCase (std::string name) | |
Constructor. | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. | |
TestCase * | GetParent () const |
Get the parent of this TestCase. | |
bool | IsStatusFailure () const |
Check if any tests failed. | |
bool | IsStatusSuccess () const |
Check if all tests passed. | |
void | SetDataDir (std::string directory) |
Set the data directory where reference trace files can be found. | |
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. | |
bool | MustAssertOnFailure () const |
Check if this run should assert on failure. | |
bool | MustContinueOnFailure () const |
Check if this run should continue on failure. | |
std::string | CreateDataDirFilename (std::string filename) |
Construct the full path to a file in the data directory. | |
std::string | CreateTempDirFilename (std::string filename) |
Construct the full path to a file in a temporary directory. | |
LrWpan ACK Test.
Definition at line 54 of file lr-wpan-ack-test.cc.
Test modes.
Definition at line 60 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 113 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 157 of file lr-wpan-ack-test.cc.
References m_requestSentTime, and ns3::Simulator::Now().
Referenced by DoRun().
void LrWpanAckTestCase::DataConfirmDev1 | ( | McpsDataConfirmParams | params | ) |
Function called when DataConfirm is hit on dev1.
params | The MCPS params. |
Definition at line 163 of file lr-wpan-ack-test.cc.
References m_replySentTime, and ns3::Simulator::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 126 of file lr-wpan-ack-test.cc.
References m_replyArrivalTime, and ns3::Simulator::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 132 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::Simulator::Now(), ns3::SHORT_ADDR, and ns3::TX_OPTION_NONE.
Referenced by DoRun().
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 169 of file lr-wpan-ack-test.cc.
References ns3::LrWpanNetDevice::AssignStreams(), ns3::TestCase::CreateTempDirFilename(), DataConfirmDev0(), DataConfirmDev1(), DataIndicationDev0(), DataIndicationDev1(), ns3::Simulator::Destroy(), ns3::AsciiTraceHelperForDevice::EnableAscii(), ns3::Packet::EnablePrinting(), ns3::EXT_ADDR, EXTENDED_ADDRESS_UNICAST, ns3::Ipv6Address::GetAllNodesMulticast(), ns3::Mac16Address::GetBroadcast(), ns3::LrWpanNetDevice::GetMac(), ns3::Mac16Address::GetMulticast(), ns3::LrWpanNetDevice::GetPhy(), m_dev0, m_dev1, m_mode, m_prefix, m_replyArrivalTime, m_replySentTime, m_replyTime, m_requestSentTime, m_requestTime, ns3::MakeCallback(), ns3::LrWpanMac::McpsDataRequest(), ns3::Simulator::Now(), NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_GT, NS_TEST_EXPECT_MSG_LT, ns3::Simulator::Run(), ns3::Simulator::ScheduleNow(), ns3::LrWpanNetDevice::SetAddress(), ns3::LrWpanNetDevice::SetChannel(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::SHORT_ADDR, SHORT_ADDRESS_BROADCAST, SHORT_ADDRESS_MULTICAST, SHORT_ADDRESS_UNICAST, and ns3::TX_OPTION_ACK.
|
private |
|
private |
2nd LrWpanNetDevice.
Definition at line 110 of file lr-wpan-ack-test.cc.
Referenced by DataIndicationDev1(), and DoRun().
|
private |
Test mode.
Definition at line 108 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), DataIndicationDev1(), and DoRun().
|
private |
Filename prefix.
Definition at line 102 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), and DoRun().
|
private |
Reply arrival time.
Definition at line 107 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), DataIndicationDev0(), and DoRun().
|
private |
Reply successfully sent time.
Definition at line 106 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), DataConfirmDev1(), and DoRun().
|
private |
Reply time.
Definition at line 105 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), DataIndicationDev1(), and DoRun().
|
private |
Request successfully sent time.
Definition at line 104 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), DataConfirmDev0(), and DoRun().
|
private |
Request time.
Definition at line 103 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), and DoRun().