Test tracked bands in interference helper upon channel switching. More...
Public Member Functions | |
SpectrumWifiPhyTrackedBandsTest () | |
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. | |
void | DoSetup () override |
Implementation to do any local setup required for this TestCase. | |
void | DoTeardown () override |
Implementation to do any local setup required for this TestCase. | |
void | RunOne (const std::vector< uint8_t > &channelNumberPerSegmentBeforeSwitching, const std::vector< uint8_t > &channelNumberPerSegmentAfterSwitching, const std::vector< std::vector< WifiSpectrumBandFrequencies > > &expectedTrackedBands, const std::vector< std::vector< WifiSpectrumBandFrequencies > > &expectedUntrackedBand) |
Run one function. | |
void | SwitchChannel (const std::vector< uint8_t > &channelNumberPerSegment) |
Switch channel function. | |
void | VerifyTrackedBands (const std::vector< std::vector< WifiSpectrumBandFrequencies > > &expectedTrackedBands, const std::vector< std::vector< WifiSpectrumBandFrequencies > > &expectedUntrackedBands) |
Verify the bands tracked by the interference helper. | |
Private Attributes | |
Ptr< ExtSpectrumWifiPhy > | m_phy |
PHY. | |
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::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 tracked bands in interference helper upon channel switching.
The test is verifying that the correct bands are tracked by the interference helper upon channel switching. It focuses on 80 and 160 MHz bands while considering 160 MHz operating channels, for both contiguous and non-contiguous cases.
Definition at line 986 of file spectrum-wifi-phy-test.cc.
SpectrumWifiPhyTrackedBandsTest::SpectrumWifiPhyTrackedBandsTest | ( | ) |
Definition at line 1032 of file spectrum-wifi-phy-test.cc.
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 1152 of file spectrum-wifi-phy-test.cc.
References ns3::Simulator::Destroy(), and RunOne().
|
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 1038 of file spectrum-wifi-phy-test.cc.
References ns3::SpectrumWifiPhy::AddChannel(), ns3::WifiPhy::ConfigureStandard(), ns3::CreateObject(), m_phy, ns3::SpectrumWifiPhy::SetDevice(), ns3::WifiPhy::SetErrorRateModel(), ns3::WifiPhy::SetInterferenceHelper(), and ns3::WIFI_STANDARD_80211ax.
|
overrideprivatevirtual |
Implementation to do any local setup required for this TestCase.
Subclasses should override this method to perform any costly per-test teardown
Reimplemented from ns3::TestCase.
Definition at line 1065 of file spectrum-wifi-phy-test.cc.
References ns3::Object::Dispose(), and m_phy.
|
private |
Run one function.
channelNumberPerSegmentBeforeSwitching | the channel number for each segment of the operating channel to switch from |
channelNumberPerSegmentAfterSwitching | the channel number for each segment of the operating channel to switch to |
expectedTrackedBands | the bands that are expected to be tracked by the interference helper |
expectedUntrackedBand | the bands that are expected to be untracked by the interference helper |
Definition at line 1124 of file spectrum-wifi-phy-test.cc.
References NS_LOG_FUNCTION, ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), SwitchChannel(), and VerifyTrackedBands().
Referenced by DoRun().
|
private |
Switch channel function.
channelNumberPerSegment | the channel number for each segment of the operating channel to switch to |
Definition at line 1072 of file spectrum-wifi-phy-test.cc.
References ns3::WifiPhyOperatingChannel::FindFirst(), m_phy, NS_LOG_FUNCTION, ns3::WifiPhy::SetOperatingChannel(), ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_STANDARD_80211ax.
Referenced by RunOne().
|
private |
Verify the bands tracked by the interference helper.
expectedTrackedBands | the bands that are expected to be tracked by the interference helper |
expectedUntrackedBands | the bands that are expected to be untracked by the interference helper |
Definition at line 1089 of file spectrum-wifi-phy-test.cc.
References ns3::DynamicCast(), ns3::PointerValue::Get(), ns3::ObjectBase::GetAttribute(), m_phy, NS_ASSERT, NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.
Referenced by RunOne().
|
private |
PHY.
Definition at line 1029 of file spectrum-wifi-phy-test.cc.
Referenced by DoSetup(), DoTeardown(), SwitchChannel(), and VerifyTrackedBands().