Test checks if Wifi spectrum values for OFDM are generated properly. More...
Public Types | |
typedef std::pair< uint32_t, double > | IndexPowerPair |
typedef for a pair of sub-band index and relative power value (dBr) More... | |
typedef std::vector< IndexPowerPair > | IndexPowerVect |
typedef for a vector of pairs of sub-band index and relative power value (dBr) More... | |
Public Types inherited from ns3::TestCase | |
enum | TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
Public Member Functions | |
WifiOfdmMaskSlopesTestCase (const std::string &name, WifiStandard standard, WifiPhyBand band, uint16_t channelWidth, const IndexPowerVect &maskRefs, double tolerance, std::size_t precision, const std::vector< bool > &puncturedSubchannels=std::vector< bool >{}) | |
Constructor. More... | |
~WifiOfdmMaskSlopesTestCase () override=default | |
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 | DoSetup () override |
Implementation to do any local setup required for this TestCase. More... | |
void | InterpolateAndAppendValues (IndexPowerVect &vect, IndexPowerPair start, IndexPowerPair stop) const |
Interpolate PSD values for indexes between provided start and stop and append to provided vector. More... | |
Private Attributes | |
Ptr< SpectrumValue > | m_actualSpectrum |
actual spectrum value More... | |
WifiPhyBand | m_band |
the wifi PHY band to use for the test More... | |
uint16_t | m_channelWidth |
the channel width in MHz to use for the test More... | |
IndexPowerVect | m_expectedPsd |
expected power values More... | |
std::size_t | m_precision |
precision for double calculations (in decimals) More... | |
std::vector< bool > | m_puncturedSubchannels |
bitmap indicating whether a 20 MHz subchannel is punctured or not (only used for 802.11ax and later) More... | |
WifiStandard | m_standard |
the wifi standard to use for the test More... | |
double | m_tolerance |
tolerance (in dB) More... | |
Additional Inherited Members | |
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 checks if Wifi spectrum values for OFDM are generated properly.
Different test cases are configured by defining different standards and bandwidth.
Definition at line 40 of file wifi-transmit-mask-test.cc.
typedef std::pair<uint32_t, double> WifiOfdmMaskSlopesTestCase::IndexPowerPair |
typedef for a pair of sub-band index and relative power value (dBr)
Definition at line 46 of file wifi-transmit-mask-test.cc.
typedef std::vector<IndexPowerPair> WifiOfdmMaskSlopesTestCase::IndexPowerVect |
typedef for a vector of pairs of sub-band index and relative power value (dBr)
Definition at line 51 of file wifi-transmit-mask-test.cc.
WifiOfdmMaskSlopesTestCase::WifiOfdmMaskSlopesTestCase | ( | const std::string & | name, |
WifiStandard | standard, | ||
WifiPhyBand | band, | ||
uint16_t | channelWidth, | ||
const IndexPowerVect & | maskRefs, | ||
double | tolerance, | ||
std::size_t | precision, | ||
const std::vector< bool > & | puncturedSubchannels = std::vector<bool>{} |
||
) |
Constructor.
name | test reference name |
standard | selected standard |
band | selected PHY band |
channelWidth | channel width (in MHz) |
maskRefs | vector of expected power values and corresponding indexes of generated PSD (only start and stop indexes/values given) |
tolerance | tolerance (in dB) |
precision | precision (in decimals) |
puncturedSubchannels | bitmap indicating whether a 20 MHz subchannel is punctured or not (only for 802.11ax and later) |
Definition at line 106 of file wifi-transmit-mask-test.cc.
References NS_LOG_FUNCTION.
|
overridedefault |
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 284 of file wifi-transmit-mask-test.cc.
References ns3::SpectrumValue::ConstValuesBegin(), ns3::SpectrumValue::ConstValuesEnd(), m_actualSpectrum, m_expectedPsd, m_tolerance, max, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, and NS_TEST_EXPECT_MSG_EQ_TOL.
|
overrideprivatevirtual |
Implementation to do any local setup required for this TestCase.
Subclasses should override this method to perform any costly per-test setup before DoRun is invoked.
Reimplemented from ns3::TestCase.
Definition at line 130 of file wifi-transmit-mask-test.cc.
References InterpolateAndAppendValues(), m_actualSpectrum, m_band, m_channelWidth, m_expectedPsd, m_puncturedSubchannels, m_standard, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::WIFI_PHY_BAND_2_4GHZ, ns3::WIFI_PHY_BAND_5GHZ, ns3::WIFI_PHY_BAND_6GHZ, ns3::WIFI_STANDARD_80211a, ns3::WIFI_STANDARD_80211ac, ns3::WIFI_STANDARD_80211ax, ns3::WIFI_STANDARD_80211g, ns3::WIFI_STANDARD_80211n, and ns3::WIFI_STANDARD_80211p.
|
private |
Interpolate PSD values for indexes between provided start and stop and append to provided vector.
vect | vector of sub-band index and relative power value pairs to which interpolated values should be appended |
start | pair of sub-band index and relative power value (dBr) for interval start |
stop | pair of sub-band index and relative power value (dBr) for interval stop |
Definition at line 254 of file wifi-transmit-mask-test.cc.
References m_precision, m_tolerance, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, two-ray-to-three-gpp-ch-calibration::start, two-ray-to-three-gpp-ch-calibration::stop, and ns3::TestDoubleIsEqual().
Referenced by DoSetup().
|
private |
actual spectrum value
Definition at line 100 of file wifi-transmit-mask-test.cc.
|
private |
the wifi PHY band to use for the test
Definition at line 95 of file wifi-transmit-mask-test.cc.
Referenced by DoSetup().
|
private |
the channel width in MHz to use for the test
Definition at line 96 of file wifi-transmit-mask-test.cc.
Referenced by DoSetup().
|
private |
expected power values
Definition at line 101 of file wifi-transmit-mask-test.cc.
|
private |
precision for double calculations (in decimals)
Definition at line 103 of file wifi-transmit-mask-test.cc.
Referenced by InterpolateAndAppendValues().
|
private |
bitmap indicating whether a 20 MHz subchannel is punctured or not (only used for 802.11ax and later)
Definition at line 98 of file wifi-transmit-mask-test.cc.
Referenced by DoSetup().
|
private |
the wifi standard to use for the test
Definition at line 94 of file wifi-transmit-mask-test.cc.
Referenced by DoSetup().
|
private |
tolerance (in dB)
Definition at line 102 of file wifi-transmit-mask-test.cc.
Referenced by DoRun(), and InterpolateAndAppendValues().