10#include "ns3/header-serialization-test.h"
39 void DoRun()
override;
52 bool multicastPending,
53 const std::list<uint16_t>& aidValues);
71 void CheckAidSet(
const Tim& tim, uint16_t aid,
const std::set<uint16_t>& expectedSet);
83 bool multicastPending,
84 const std::list<uint16_t>& aidValues)
90 tim.
AddAid(aidValues.begin(), aidValues.end());
96 const std::vector<uint8_t>& bufferContents)
111 bufferContents.at(j - 4),
112 "Serialization is different than provided known serialization");
126 const std::set<uint16_t>& expectedSet)
131 std::vector<uint16_t> diff;
134 std::set_difference(expectedSet.cbegin(),
138 std::back_inserter(diff));
140 std::stringstream ss;
141 std::copy(diff.cbegin(), diff.cend(), std::ostream_iterator<uint16_t>(ss,
" "));
145 "Expected elements not returned by GetAidSet(): " << ss.str());
148 std::vector<uint16_t> diff;
151 std::set_difference(ret.cbegin(),
153 expectedSet.cbegin(),
155 std::back_inserter(diff));
157 std::stringstream ss;
158 std::copy(diff.cbegin(), diff.cend(), std::ostream_iterator<uint16_t>(ss,
" "));
162 "Returned elements not expected by GetAidSet(): " << ss.str());
174 SetTim(tim, 0, 3,
false, {2, 7});
184 SetTim(tim, 0, 3,
true, {2, 7, 22, 24});
210 SetTim(tim, 0, 3,
true, {24});
216 SetTim(tim, 0, 3,
false, {2000});
218 SetTim(tim, 1, 3,
true, {1, 134});
220 SetTim(tim, 1, 3,
false, {1, 2});
231 SetTim(tim, 0, 3,
true, {});
242 SetTim(tim, 0, 3,
false, {});
iterator in a Buffer instance
automatically resized byte buffer
void AddAtStart(uint32_t start)
Buffer::Iterator Begin() const
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
The Traffic Indication Map Information Element.
uint8_t m_dtimPeriod
The DTIM Period field.
uint8_t m_dtimCount
The DTIM Count field.
void AddAid(uint16_t aid)
Add the provided AID value to the list contained in the Virtual Bitmap.
std::set< uint16_t > GetAidSet(uint16_t aid=0) const
Return the AID values, greater than the given AID value, whose corresponding bits are set in the virt...
bool m_hasMulticastPending
Whether there is Multicast / Broadcast data.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static PowerSaveTestSuite g_powerSaveTestSuite
the test suite