Test extraction of expired MPDUs from MAC queue container. More...
Public Member Functions | |
WifiExtractExpiredMpdusTest () | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | DoRun () override |
Implementation to actually run this TestCase. More... | |
void | Enqueue (Mac48Address rxAddr, bool inflight, Time expiryTime) |
Enqueue a new MPDU into the container. More... | |
Private Attributes | |
WifiMacQueueContainer | m_container |
MAC queue container. More... | |
uint16_t | m_currentSeqNo {0} |
sequence number of current MPDU More... | |
Mac48Address | m_txAddr |
Transmitter Address of MPDUs. More... | |
Additional Inherited Members | |
Public Types inherited from ns3::TestCase | |
enum | TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
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 TestCase. More... | |
bool | IsStatusFailure () const |
Check if any tests failed. More... | |
bool | IsStatusSuccess () 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 () const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure () 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... | |
Test extraction of expired MPDUs from MAC queue container.
This test verifies the correctness of the WifiMacQueueContainer methods (ExtractExpiredMpdus and ExtractAllExpiredMpdus) that extract MPDUs with expired lifetime from the MAC queue container.
Definition at line 135 of file wifi-mac-queue-test.cc.
WifiExtractExpiredMpdusTest::WifiExtractExpiredMpdusTest | ( | ) |
Definition at line 157 of file wifi-mac-queue-test.cc.
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
At simulation time 25ms:
Container queue for rxAddr1 ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ │Exp│Exp│Exp│Exp│ │ │ │ │ │ │ │ │Inf│ │Inf│ │Inf│ │Inf│ │ │ │ │ │ 0 │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │10 │ └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘
Container queue for rxAddr2 ┌───┬───┬───┬───┬───┬───┬───┬───┬───┐ │Exp│Exp│Exp│ │ │ │ │ │ │ │ │Inf│Inf│ │Inf│Inf│ │ │ │ │11 │12 │13 │14 │15 │16 │17 │18 │19 │ └───┴───┴───┴───┴───┴───┴───┴───┴───┘
Extract expired MPDUs from container queue 1
Extract expired MPDUs from container queue 2
At simulation time 50ms:
Container queue for rxAddr1 ┌───┬───┬───┬───┬───┬───┬───┬───┬───┐ │Exp│Exp│Exp│Exp│Exp│Exp│Exp│ │ │ │Inf│Inf│Inf│ │Inf│ │ │ │ │ │ 0 │ 2 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │10 │ └───┴───┴───┴───┴───┴───┴───┴───┴───┘
Container queue for rxAddr2 ┌───┬───┬───┬───┬───┬───┬───┬───┐ │Exp│Exp│Exp│Exp│Exp│Exp│ │ │ │Inf│Inf│ │Inf│Inf│ │ │ │ │12 │13 │14 │15 │16 │17 │18 │19 │ └───┴───┴───┴───┴───┴───┴───┴───┘
Extract all expired MPDUs (from container queue 1 and 2)
Check MPDUs remaining in container queue 1
Check MPDUs remaining in container queue 2
Implements ns3::TestCase.
Definition at line 183 of file wifi-mac-queue-test.cc.
References Enqueue(), ns3::WifiMacQueueContainer::ExtractAllExpiredMpdus(), ns3::WifiMacQueueContainer::ExtractExpiredMpdus(), ns3::WifiMacQueueContainer::GetQueue(), m_container, m_txAddr, ns3::MilliSeconds(), NS_TEST_EXPECT_MSG_EQ, ns3::WIFI_QOSDATA_QUEUE, and ns3::WIFI_UNICAST.
|
private |
Enqueue a new MPDU into the container.
rxAddr | Receiver Address of the MPDU |
inflight | whether the MPDU is inflight |
expiryTime | the expity time for the MPDU |
Definition at line 163 of file wifi-mac-queue-test.cc.
References ns3::WifiMacQueueContainer::GetQueue(), ns3::WifiMacQueueContainer::insert(), m_container, m_currentSeqNo, m_txAddr, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetSequenceNumber(), and ns3::WIFI_MAC_QOSDATA.
Referenced by DoRun().
|
private |
MAC queue container.
Definition at line 152 of file wifi-mac-queue-test.cc.
|
private |
sequence number of current MPDU
Definition at line 153 of file wifi-mac-queue-test.cc.
Referenced by Enqueue().
|
private |
Transmitter Address of MPDUs.
Definition at line 154 of file wifi-mac-queue-test.cc.