Test the calculation of the largest idle primary channel performed by ChannelAccessManager::GetLargestIdlePrimaryChannel(). More...
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 |
TestCase & | operator= (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< ChannelAccessManager > | m_cam |
channel access manager | |
Ptr< SpectrumWifiPhy > | m_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. | |
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 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.
LargestIdlePrimaryChannelTest::LargestIdlePrimaryChannelTest | ( | ) |
Definition at line 1363 of file channel-access-manager-test.cc.
|
overridedefault |
|
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.
|
private |
Test a specific combination of operating channel width and busy channel type.
chWidth | the operating channel width |
busyChannel | the 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().
|
private |
channel access manager
Definition at line 1359 of file channel-access-manager-test.cc.
|
private |