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 class | Duration { 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 | |
Static Public Attributes inherited from ns3::TestCase | |
static constexpr auto | QUICK = Duration::QUICK |
Deprecated test duration simple enums. | |
static constexpr auto | EXTENSIVE = Duration::EXTENSIVE |
static constexpr auto | TAKES_FOREVER = Duration::TAKES_FOREVER |
Protected Member Functions inherited from ns3::TestCase | |
TestCase (std::string name) | |
Constructor. | |
void | AddTestCase (TestCase *testCase, Duration duration=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 44 of file lr-wpan-ack-test.cc.
Test modes.
Definition at line 50 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 103 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 147 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 153 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 116 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 122 of file lr-wpan-ack-test.cc.
References ns3::Create(), ns3::lrwpan::EXT_ADDR, EXTENDED_ADDRESS_UNICAST, m_dev1, ns3::lrwpan::McpsDataRequestParams::m_dstAddr, ns3::lrwpan::McpsDataRequestParams::m_dstAddrMode, ns3::lrwpan::McpsDataRequestParams::m_dstExtAddr, ns3::lrwpan::McpsDataRequestParams::m_dstPanId, m_mode, ns3::lrwpan::McpsDataRequestParams::m_msduHandle, m_replyTime, ns3::lrwpan::McpsDataRequestParams::m_srcAddrMode, ns3::lrwpan::McpsDataRequestParams::m_txOptions, ns3::Simulator::Now(), ns3::lrwpan::SHORT_ADDR, and ns3::lrwpan::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 159 of file lr-wpan-ack-test.cc.
References ns3::LrWpanHelper::AddPropagationLossModel(), ns3::lrwpan::LrWpanNetDevice::AssignStreams(), ns3::Create(), ns3::NodeContainer::Create(), ns3::CreateObject(), ns3::TestCase::CreateTempDirFilename(), DataConfirmDev0(), DataConfirmDev1(), DataIndicationDev0(), DataIndicationDev1(), ns3::Simulator::Destroy(), ns3::AsciiTraceHelperForDevice::EnableAscii(), ns3::Packet::EnablePrinting(), ns3::lrwpan::EXT_ADDR, EXTENDED_ADDRESS_UNICAST, ns3::Ipv6Address::GetAllNodesMulticast(), ns3::Mac16Address::GetBroadcast(), ns3::Mac16Address::GetMulticast(), ns3::LrWpanHelper::Install(), m_dev0, m_dev1, m_mode, m_prefix, m_replyArrivalTime, m_replySentTime, m_replyTime, m_requestSentTime, m_requestTime, ns3::MakeCallback(), ns3::lrwpan::LrWpanMac::McpsDataRequest(), nodes, 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::LrWpanHelper::SetPropagationDelayModel(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::lrwpan::SHORT_ADDR, SHORT_ADDRESS_BROADCAST, SHORT_ADDRESS_MULTICAST, SHORT_ADDRESS_UNICAST, and ns3::lrwpan::TX_OPTION_ACK.
|
private |
|
private |
2nd LrWpanNetDevice.
Definition at line 100 of file lr-wpan-ack-test.cc.
Referenced by DataIndicationDev1(), and DoRun().
|
private |
Test mode.
Definition at line 98 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), DataIndicationDev1(), and DoRun().
|
private |
Filename prefix.
Definition at line 92 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), and DoRun().
|
private |
Reply arrival time.
Definition at line 97 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), DataIndicationDev0(), and DoRun().
|
private |
Reply successfully sent time.
Definition at line 96 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), DataConfirmDev1(), and DoRun().
|
private |
Reply time.
Definition at line 95 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), DataIndicationDev1(), and DoRun().
|
private |
Request successfully sent time.
Definition at line 94 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), DataConfirmDev0(), and DoRun().
|
private |
Request time.
Definition at line 93 of file lr-wpan-ack-test.cc.
Referenced by LrWpanAckTestCase(), and DoRun().