20#include "ns3/assert.h"
21#include "ns3/header-serialization-test.h"
50 void DoRun()
override;
63 bool multicastPending,
64 const std::list<uint16_t>& aidValues);
82 void CheckAidSet(
const Tim& tim, uint16_t aid,
const std::set<uint16_t>& expectedSet);
94 bool multicastPending,
95 const std::list<uint16_t>& aidValues)
101 tim.
AddAid(aidValues.begin(), aidValues.end());
107 const std::vector<uint8_t>& bufferContents)
122 bufferContents.at(j - 4),
123 "Serialization is different than provided known serialization");
137 const std::set<uint16_t>& expectedSet)
142 std::vector<uint16_t> diff;
145 std::set_difference(expectedSet.cbegin(),
149 std::back_inserter(diff));
151 std::stringstream ss;
152 std::copy(diff.cbegin(), diff.cend(), std::ostream_iterator<uint16_t>(ss,
" "));
156 "Expected elements not returned by GetAidSet(): " << ss.str());
159 std::vector<uint16_t> diff;
162 std::set_difference(ret.cbegin(),
164 expectedSet.cbegin(),
166 std::back_inserter(diff));
168 std::stringstream ss;
169 std::copy(diff.cbegin(), diff.cend(), std::ostream_iterator<uint16_t>(ss,
" "));
173 "Returned elements not expected by GetAidSet(): " << ss.str());
185 SetTim(tim, 0, 3,
false, {2, 7});
195 SetTim(tim, 0, 3,
true, {2, 7, 22, 24});
221 SetTim(tim, 0, 3,
true, {24});
227 SetTim(tim, 0, 3,
false, {2000});
229 SetTim(tim, 1, 3,
true, {1, 134});
231 SetTim(tim, 1, 3,
false, {1, 2});
242 SetTim(tim, 0, 3,
true, {});
253 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