A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
SpectrumWifiPhyTrackedBandsTest Class Reference

Test tracked bands in interference helper upon channel switching. More...

+ Inheritance diagram for SpectrumWifiPhyTrackedBandsTest:
+ Collaboration diagram for SpectrumWifiPhyTrackedBandsTest:

Public Member Functions

 SpectrumWifiPhyTrackedBandsTest ()
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (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< ExtSpectrumWifiPhym_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.
 
TestCaseGetParent () 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SpectrumWifiPhyTrackedBandsTest()

SpectrumWifiPhyTrackedBandsTest::SpectrumWifiPhyTrackedBandsTest ( )

Definition at line 1032 of file spectrum-wifi-phy-test.cc.

Member Function Documentation

◆ DoRun()

void SpectrumWifiPhyTrackedBandsTest::DoRun ( )
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().

+ Here is the call graph for this function:

◆ DoSetup()

void SpectrumWifiPhyTrackedBandsTest::DoSetup ( )
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.

+ Here is the call graph for this function:

◆ DoTeardown()

void SpectrumWifiPhyTrackedBandsTest::DoTeardown ( )
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.

+ Here is the call graph for this function:

◆ RunOne()

void SpectrumWifiPhyTrackedBandsTest::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 )
private

Run one function.

Parameters
channelNumberPerSegmentBeforeSwitchingthe channel number for each segment of the operating channel to switch from
channelNumberPerSegmentAfterSwitchingthe channel number for each segment of the operating channel to switch to
expectedTrackedBandsthe bands that are expected to be tracked by the interference helper
expectedUntrackedBandthe 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SwitchChannel()

void SpectrumWifiPhyTrackedBandsTest::SwitchChannel ( const std::vector< uint8_t > & channelNumberPerSegment)
private

Switch channel function.

Parameters
channelNumberPerSegmentthe 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VerifyTrackedBands()

void SpectrumWifiPhyTrackedBandsTest::VerifyTrackedBands ( const std::vector< std::vector< WifiSpectrumBandFrequencies > > & expectedTrackedBands,
const std::vector< std::vector< WifiSpectrumBandFrequencies > > & expectedUntrackedBands )
private

Verify the bands tracked by the interference helper.

Parameters
expectedTrackedBandsthe bands that are expected to be tracked by the interference helper
expectedUntrackedBandsthe 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_phy

Ptr<ExtSpectrumWifiPhy> SpectrumWifiPhyTrackedBandsTest::m_phy
private

PHY.

Definition at line 1029 of file spectrum-wifi-phy-test.cc.

Referenced by DoSetup(), DoTeardown(), SwitchChannel(), and VerifyTrackedBands().


The documentation for this class was generated from the following file: