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 char *str, WifiStandard standard, WifiPhyBand band, uint8_t bw, IndexPowerVect maskRefsLeft, IndexPowerVect maskRefsRight, double tol) | |
Constructor. More... | |
virtual | ~WifiOfdmMaskSlopesTestCase () |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName (void) const |
TestCase & | operator= (const TestCase &)=delete |
Protected Attributes | |
Ptr< SpectrumValue > | m_actualSpectrum |
actual spectrum value More... | |
IndexPowerVect | m_expectedLeftPsd |
expected power values for left guard bandwidth More... | |
IndexPowerVect | m_expectedRightPsd |
expected power values for right guard bandwidth More... | |
double | m_tolerance |
tolerance (in dB) More... | |
Private Member Functions | |
void | DoRun (void) override |
Implementation to actually run this TestCase. More... | |
Static Private Member Functions | |
static void | InterpolateAndAppendValues (IndexPowerVect &vect, IndexPowerPair start, IndexPowerPair stop, double tol) |
Interpolate PSD values for indexes between provided start and stop and append to provided vector. 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 TestCsse. More... | |
bool | IsStatusFailure (void) const |
Check if any tests failed. More... | |
bool | IsStatusSuccess (void) 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 (void) const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure (void) 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 char * | str, |
WifiStandard | standard, | ||
WifiPhyBand | band, | ||
uint8_t | bw, | ||
IndexPowerVect | maskRefsLeft, | ||
IndexPowerVect | maskRefsRight, | ||
double | tol | ||
) |
Constructor.
str | test reference name |
standard | selected standard |
band | selected PHY band |
bw | bandwidth |
maskRefsLeft | vector of expected power values and corresponding indexes of generated PSD (only start and stop indexes/values given) for left guard bandwidth |
maskRefsRight | vector of expected power values and corresponding indexes of generated PSD (only start and stop indexes/values given) for right guard bandwidth |
tol | tolerance (in dB) |
Definition at line 92 of file wifi-transmit-mask-test.cc.
References InterpolateAndAppendValues(), m_actualSpectrum, m_expectedLeftPsd, m_expectedRightPsd, m_tolerance, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::WIFI_PHY_BAND_2_4GHZ, 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.
|
virtual |
Definition at line 171 of file wifi-transmit-mask-test.cc.
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 202 of file wifi-transmit-mask-test.cc.
References ns3::SpectrumValue::ConstValuesBegin(), ns3::SpectrumValue::ConstValuesEnd(), m_actualSpectrum, m_expectedLeftPsd, m_expectedRightPsd, m_tolerance, max, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, and NS_TEST_EXPECT_MSG_EQ_TOL.
|
staticprivate |
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 |
tol | tolerance (in dB) |
Definition at line 176 of file wifi-transmit-mask-test.cc.
References NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, visualizer.core::start(), and ns3::TestDoubleIsEqual().
Referenced by WifiOfdmMaskSlopesTestCase().
|
protected |
actual spectrum value
Definition at line 71 of file wifi-transmit-mask-test.cc.
Referenced by WifiOfdmMaskSlopesTestCase(), and DoRun().
|
protected |
expected power values for left guard bandwidth
Definition at line 72 of file wifi-transmit-mask-test.cc.
Referenced by WifiOfdmMaskSlopesTestCase(), and DoRun().
|
protected |
expected power values for right guard bandwidth
Definition at line 73 of file wifi-transmit-mask-test.cc.
Referenced by WifiOfdmMaskSlopesTestCase(), and DoRun().
|
protected |
tolerance (in dB)
Definition at line 74 of file wifi-transmit-mask-test.cc.
Referenced by WifiOfdmMaskSlopesTestCase(), and DoRun().