Test serialization and deserialization of EHT capabilities IE. More...
Public Member Functions | |
WifiEhtCapabilitiesIeTest (bool is2_4Ghz, MHz_u channelWidth) | |
Constructor. | |
~WifiEhtCapabilitiesIeTest () override=default | |
void | CheckEhtMacCapabilitiesInformation (const Buffer &buffer, uint8_t expectedValueFirstByte) |
Check the content of the EHT MAC Capabilities Information subfield. | |
void | CheckEhtPhyCapabilitiesInformation (const Buffer &buffer, uint8_t expectedValueSixthByte) |
Check the content of the EHT PHY Capabilities Information subfield. | |
void | CheckSerializedByte (const Buffer &buffer, uint32_t position, uint8_t value) |
Check that the given buffer contains the given value at the given position. | |
void | CheckSupportedEhtMcsAndNssSet (const Buffer &buffer, uint8_t maxSupportedMcs) |
Check the content of the Supported EHT-MCS And NSS Set subfield. | |
EhtCapabilities | GetEhtCapabilities (uint16_t maxMpduLength, uint32_t maxAmpduSize, uint8_t maxSupportedMcs) const |
Generate the EHT capabilities IE. | |
HeCapabilities | GetHeCapabilities () const |
Generate the HE capabilities IE. | |
Buffer | SerializeIntoBuffer (const EhtCapabilities &ehtCapabilities) |
Serialize the EHT capabilities in a buffer. | |
Public Member Functions inherited from ns3::HeaderSerializationTestCase | |
template<typename T , typename... Args> | |
void | TestHeaderSerialization (const T &hdr, Args &&... args) |
Serialize the given header in a buffer, then create a new header by deserializing from the buffer and serialize the new header into a new buffer. | |
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 | |
MHz_u | m_channelWidth |
Supported channel width by the PHY. | |
bool | m_is2_4Ghz |
whether the PHY is operating in 2.4 GHz | |
Additional Inherited Members | |
Public Types inherited from ns3::TestCase | |
enum class | Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
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::HeaderSerializationTestCase | |
HeaderSerializationTestCase (std::string name) | |
Constructor. | |
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. | |
Test serialization and deserialization of EHT capabilities IE.
Definition at line 765 of file wifi-eht-info-elems-test.cc.
WifiEhtCapabilitiesIeTest::WifiEhtCapabilitiesIeTest | ( | bool | is2_4Ghz, |
MHz_u | channelWidth ) |
Constructor.
is2_4Ghz | whether the PHY is operating in 2.4 GHz |
channelWidth | the supported channel width |
Definition at line 843 of file wifi-eht-info-elems-test.cc.
|
overridedefault |
void WifiEhtCapabilitiesIeTest::CheckEhtMacCapabilitiesInformation | ( | const Buffer & | buffer, |
uint8_t | expectedValueFirstByte ) |
Check the content of the EHT MAC Capabilities Information subfield.
buffer | the buffer containing the serialized EHT capabilities |
expectedValueFirstByte | the expected value for the first byte |
Definition at line 971 of file wifi-eht-info-elems-test.cc.
References CheckSerializedByte().
Referenced by DoRun().
void WifiEhtCapabilitiesIeTest::CheckEhtPhyCapabilitiesInformation | ( | const Buffer & | buffer, |
uint8_t | expectedValueSixthByte ) |
Check the content of the EHT PHY Capabilities Information subfield.
buffer | the buffer containing the serialized EHT capabilities |
expectedValueSixthByte | the expected value for the sixth byte |
Definition at line 979 of file wifi-eht-info-elems-test.cc.
References CheckSerializedByte(), and m_channelWidth.
Referenced by DoRun().
void WifiEhtCapabilitiesIeTest::CheckSerializedByte | ( | const Buffer & | buffer, |
uint32_t | position, | ||
uint8_t | value ) |
Check that the given buffer contains the given value at the given position.
buffer | the given buffer |
position | the given position (starting at 0) |
value | the given value |
Definition at line 960 of file wifi-eht-info-elems-test.cc.
References ns3::Buffer::Begin(), ns3::Buffer::Iterator::Next(), NS_TEST_EXPECT_MSG_EQ, and ns3::Buffer::Iterator::ReadU8().
Referenced by CheckEhtMacCapabilitiesInformation(), CheckEhtPhyCapabilitiesInformation(), and CheckSupportedEhtMcsAndNssSet().
void WifiEhtCapabilitiesIeTest::CheckSupportedEhtMcsAndNssSet | ( | const Buffer & | buffer, |
uint8_t | maxSupportedMcs ) |
Check the content of the Supported EHT-MCS And NSS Set subfield.
maxSupportedMcs | the maximum EHT MCS supported by the PHY |
buffer | the buffer containing the serialized EHT capabilities |
Definition at line 994 of file wifi-eht-info-elems-test.cc.
References CheckSerializedByte(), and m_channelWidth.
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 1052 of file wifi-eht-info-elems-test.cc.
References CheckEhtMacCapabilitiesInformation(), CheckEhtPhyCapabilitiesInformation(), CheckSupportedEhtMcsAndNssSet(), ns3::EhtMcsAndNssSet::EHT_MCS_MAP_TYPE_20_MHZ_ONLY, ns3::EhtMcsAndNssSet::EHT_MCS_MAP_TYPE_NOT_LARGER_THAN_80_MHZ, GetEhtCapabilities(), GetHeCapabilities(), ns3::EhtCapabilities::GetHighestSupportedRxMcs(), ns3::EhtCapabilities::GetHighestSupportedTxMcs(), ns3::WifiInformationElement::GetSerializedSize(), m_channelWidth, m_is2_4Ghz, NS_ASSERT, NS_ASSERT_MSG, NS_TEST_EXPECT_MSG_EQ, SerializeIntoBuffer(), ns3::EhtCapabilities::SetPpeThresholds(), and ns3::HeaderSerializationTestCase::TestHeaderSerialization().
EhtCapabilities WifiEhtCapabilitiesIeTest::GetEhtCapabilities | ( | uint16_t | maxMpduLength, |
uint32_t | maxAmpduSize, | ||
uint8_t | maxSupportedMcs ) const |
Generate the EHT capabilities IE.
maxMpduLength | the maximum MPDU length in bytes |
maxAmpduSize | the maximum A-MPDU size in bytes |
maxSupportedMcs | the maximum EHT MCS supported by the PHY |
Definition at line 872 of file wifi-eht-info-elems-test.cc.
References ns3::EhtMcsAndNssSet::EHT_MCS_MAP_TYPE_160_MHZ, ns3::EhtMcsAndNssSet::EHT_MCS_MAP_TYPE_20_MHZ_ONLY, ns3::EhtMcsAndNssSet::EHT_MCS_MAP_TYPE_320_MHZ, ns3::EhtMcsAndNssSet::EHT_MCS_MAP_TYPE_NOT_LARGER_THAN_80_MHZ, m_channelWidth, m_is2_4Ghz, ns3::EhtCapabilities::m_phyCapabilities, ns3::EhtCapabilities::SetMaxAmpduLength(), ns3::EhtCapabilities::SetMaxMpduLength(), ns3::EhtCapabilities::SetSupportedRxEhtMcsAndNss(), ns3::EhtCapabilities::SetSupportedTxEhtMcsAndNss(), ns3::EhtPhyCapabilities::support320MhzIn6Ghz, ns3::EhtPhyCapabilities::supportRx1024And4096QamForRuSmallerThan242Tones, and ns3::EhtPhyCapabilities::supportTx1024And4096QamForRuSmallerThan242Tones.
Referenced by DoRun().
HeCapabilities WifiEhtCapabilitiesIeTest::GetHeCapabilities | ( | ) | const |
Generate the HE capabilities IE.
Definition at line 851 of file wifi-eht-info-elems-test.cc.
References m_channelWidth, m_is2_4Ghz, and ns3::HeCapabilities::SetChannelWidthSet().
Referenced by DoRun().
Buffer WifiEhtCapabilitiesIeTest::SerializeIntoBuffer | ( | const EhtCapabilities & | ehtCapabilities | ) |
Serialize the EHT capabilities in a buffer.
ehtCapabilities | the EHT capabilities |
Definition at line 951 of file wifi-eht-info-elems-test.cc.
References ns3::Buffer::AddAtStart(), ns3::Buffer::Begin(), ns3::WifiInformationElement::GetSerializedSize(), and ns3::WifiInformationElement::Serialize().
Referenced by DoRun().
|
private |
Supported channel width by the PHY.
Definition at line 840 of file wifi-eht-info-elems-test.cc.
Referenced by CheckEhtPhyCapabilitiesInformation(), CheckSupportedEhtMcsAndNssSet(), DoRun(), GetEhtCapabilities(), and GetHeCapabilities().
|
private |
whether the PHY is operating in 2.4 GHz
Definition at line 839 of file wifi-eht-info-elems-test.cc.
Referenced by DoRun(), GetEhtCapabilities(), and GetHeCapabilities().