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

Test the calculation of the largest idle primary channel performed by ChannelAccessManager::GetLargestIdlePrimaryChannel(). More...

+ Inheritance diagram for LargestIdlePrimaryChannelTest:
+ Collaboration diagram for LargestIdlePrimaryChannelTest:

Public Member Functions

 LargestIdlePrimaryChannelTest ()
 
 ~LargestIdlePrimaryChannelTest () override=default
 
- 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 RunOne (MHz_u chWidth, WifiChannelListType busyChannel)
 Test a specific combination of operating channel width and busy channel type.
 

Private Attributes

Ptr< ChannelAccessManagerm_cam
 channel access manager
 
Ptr< SpectrumWifiPhym_phy
 PHY object.
 

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 the calculation of the largest idle primary channel performed by ChannelAccessManager::GetLargestIdlePrimaryChannel().

In every test, the ChannelAccessManager is notified of a CCA_BUSY period and subsequently of the start of RX. The value returned by GetLargestIdlePrimaryChannel() is checked at different times and for different intervals. All the possible combinations of operating channel width and busy channel type are tested.

Definition at line 1342 of file channel-access-manager-test.cc.

Constructor & Destructor Documentation

◆ LargestIdlePrimaryChannelTest()

LargestIdlePrimaryChannelTest::LargestIdlePrimaryChannelTest ( )

Definition at line 1363 of file channel-access-manager-test.cc.

◆ ~LargestIdlePrimaryChannelTest()

LargestIdlePrimaryChannelTest::~LargestIdlePrimaryChannelTest ( )
overridedefault

Member Function Documentation

◆ DoRun()

void LargestIdlePrimaryChannelTest::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 1491 of file channel-access-manager-test.cc.

References ns3::CreateObject(), ns3::Simulator::Destroy(), m_cam, m_phy, ns3::Simulator::Run(), RunOne(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_STANDARD_80211ax.

+ Here is the call graph for this function:

◆ RunOne()

void LargestIdlePrimaryChannelTest::RunOne ( MHz_u chWidth,
WifiChannelListType busyChannel )
private

Test a specific combination of operating channel width and busy channel type.

Parameters
chWidththe operating channel width
busyChannelthe busy channel type
            <  Interval1  >< Interval2 >
                           <     Interval3   >
                                  < Interval4>       < Interval5 >
                                                  <  Interval6   >

-----—|----—^-----------—^---------—^--—^---—^---------—^— P20 | | | | | RX | | -----—|----—|--—IDLE--—|-—IDLE-—|--—|---—|---------—|— S20 | | | | | | IDLE | -----—|----—v-----------—v---------—v--—|---—|---------—|— S40 | | CCA_BUSY | IDLE | | | -----—|--------------------------—|--------—|---—|---------—|— S80 | | | | | -----—|-------------------—|---—v--—|--—v---—|---------—|— start Check times: t1 t2 t3 t5 t4 t6

Definition at line 1369 of file channel-access-manager-test.cc.

References m_cam, ns3::MilliSeconds(), ns3::ChannelAccessManager::NotifyCcaBusyStartNow(), ns3::ChannelAccessManager::NotifyRxStartNow(), ns3::Simulator::Now(), NS_TEST_EXPECT_MSG_EQ, ns3::Simulator::Schedule(), and ns3::Seconds().

Referenced by DoRun().

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

Member Data Documentation

◆ m_cam

Ptr<ChannelAccessManager> LargestIdlePrimaryChannelTest::m_cam
private

channel access manager

Definition at line 1359 of file channel-access-manager-test.cc.

Referenced by DoRun(), and RunOne().

◆ m_phy

Ptr<SpectrumWifiPhy> LargestIdlePrimaryChannelTest::m_phy
private

PHY object.

Definition at line 1360 of file channel-access-manager-test.cc.

Referenced by DoRun().


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