22 #include "ns3/qos-utils.h" 23 #include "ns3/ctrl-headers.h" 70 virtual void DoRun (
void);
75 :
TestCase (
"Check correct order of buffering when startSequence < endSeq")
91 std::list<uint16_t> m_buffer;
92 std::list<uint16_t>::iterator i,j;
93 m_buffer.push_back (0);
94 m_buffer.push_back (16);
95 m_buffer.push_back (56000);
97 uint16_t endSeq = 4000;
99 uint16_t receivedSeq = 4001 * 16;
102 for (i = m_buffer.begin (); i != m_buffer.end (); i++)
110 m_buffer.insert (i, receivedSeq);
112 receivedSeq = 3999 * 16;
115 for (i = m_buffer.begin (); i != m_buffer.end (); i++)
123 m_buffer.insert (i, receivedSeq);
125 for (i = m_buffer.begin (), j =
m_expectedBuffer.begin (); i != m_buffer.end (); i++, j++)
167 virtual void DoRun (
void);
172 :
TestCase (
"Check correct order of buffering when startSequence > endSeq")
189 std::list<uint16_t> m_buffer;
190 std::list<uint16_t>::iterator i,j;
191 m_buffer.push_back (256);
192 m_buffer.push_back (64000);
193 m_buffer.push_back (16);
195 uint16_t endSeq = 10;
197 uint16_t receivedSeq = 15 * 16;
200 for (i = m_buffer.begin (); i != m_buffer.end (); i++)
208 m_buffer.insert (i, receivedSeq);
210 receivedSeq = 15 * 16 + 1;
213 for (i = m_buffer.begin (); i != m_buffer.end (); i++)
221 m_buffer.insert (i, receivedSeq);
223 receivedSeq = 4050 * 16;
226 for (i = m_buffer.begin (); i != m_buffer.end (); i++)
234 m_buffer.insert (i, receivedSeq);
236 for (i = m_buffer.begin (), j =
m_expectedBuffer.begin (); i != m_buffer.end (); i++, j++)
254 virtual void DoRun ();
259 :
TestCase (
"Check the correctness of block ack compressed bitmap")
271 for (uint16_t i = 179; i < 220; i++)
275 for (uint16_t i = 225; i <= 242; i++)
291 for (uint16_t i = 4090; i != 10; i = (i + 1) % 4096)
295 for (uint16_t i = 22; i < 25; i++)
std::list< uint16_t > m_expectedBuffer
expected test buffer
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
virtual ~PacketBufferingCaseA()
virtual ~PacketBufferingCaseB()
virtual void DoRun(void)
Implementation to actually run this TestCase.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t QosUtilsMapSeqControlToUniqueInteger(uint16_t seqControl, uint16_t endSequence)
Next function is useful to correctly sort buffered packets under block ack.
virtual void DoRun(void)
Implementation to actually run this TestCase.
static BlockAckTestSuite g_blockAckTestSuite
the test suite
std::list< uint16_t > m_expectedBuffer
expected test buffer