Wifi Phy Reception Test base class. More...
Public Member Functions | |
WifiPhyReceptionTest (std::string test_name) | |
Constructor. | |
~WifiPhyReceptionTest () override=default | |
Destructor. | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Protected Member Functions | |
void | CheckPhyState (WifiPhyState expectedState) |
Schedule now to check the PHY state. | |
void | DoCheckPhyState (WifiPhyState expectedState) |
Check the PHY state now. | |
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 | SendPacket (dBm_u rxPower, uint32_t packetSize, uint8_t mcs) |
Send packet function. | |
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. | |
Protected Attributes | |
Ptr< SpectrumWifiPhy > | m_phy |
the PHY | |
uint64_t | m_uid {0} |
the UID to use for the PPDU | |
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 |
Wifi Phy Reception Test base class.
Definition at line 61 of file wifi-phy-reception-test.cc.
WifiPhyReceptionTest::WifiPhyReceptionTest | ( | std::string | test_name | ) |
Constructor.
test_name | the test name |
Definition at line 102 of file wifi-phy-reception-test.cc.
|
overridedefault |
Destructor.
|
protected |
Schedule now to check the PHY state.
expectedState | the expected PHY state |
Definition at line 148 of file wifi-phy-reception-test.cc.
References DoCheckPhyState(), and ns3::Simulator::ScheduleNow().
Referenced by TestPhyHeadersReception::DoRun(), TestThresholdPreambleDetectionWithFrameCapture::DoRun(), and TestThresholdPreambleDetectionWithoutFrameCapture::DoRun().
|
protected |
Check the PHY state now.
expectedState | the expected PHY state |
Definition at line 156 of file wifi-phy-reception-test.cc.
References ns3::DynamicCast(), ns3::PointerValue::Get(), m_phy, ns3::Simulator::Now(), NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.
Referenced by CheckPhyState().
|
overrideprotectedvirtual |
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 171 of file wifi-phy-reception-test.cc.
References CHANNEL_NUMBER, ns3::CreateObject(), m_phy, ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_STANDARD_80211ax.
Referenced by TestAmpduReception::DoSetup(), TestSimpleFrameCaptureModel::DoSetup(), TestThresholdPreambleDetectionWithFrameCapture::DoSetup(), and TestThresholdPreambleDetectionWithoutFrameCapture::DoSetup().
|
overrideprotectedvirtual |
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 190 of file wifi-phy-reception-test.cc.
References m_phy.
Send packet function.
rxPower | the transmit power |
packetSize | the size of the packet in bytes |
mcs | the MCS to transmit the packet |
Definition at line 108 of file wifi-phy-reception-test.cc.
References CHANNEL_WIDTH, ns3::Create(), ns3::WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(), ns3::DbmToW(), FREQUENCY, ns3::HePhy::GetHeMcs(), GUARD_WIDTH, m_phy, m_uid, ns3::NanoSeconds(), packetSize, ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_SU.
Referenced by TestPhyHeadersReception::DoRun(), TestSimpleFrameCaptureModel::DoRun(), TestThresholdPreambleDetectionWithFrameCapture::DoRun(), and TestThresholdPreambleDetectionWithoutFrameCapture::DoRun().
|
protected |
the PHY
Definition at line 98 of file wifi-phy-reception-test.cc.
Referenced by TestAmpduReception::CheckPhyState(), DoCheckPhyState(), TestAmpduReception::DoRun(), TestPhyHeadersReception::DoRun(), TestSimpleFrameCaptureModel::DoRun(), TestThresholdPreambleDetectionWithFrameCapture::DoRun(), TestThresholdPreambleDetectionWithoutFrameCapture::DoRun(), TestAmpduReception::DoSetup(), TestSimpleFrameCaptureModel::DoSetup(), TestThresholdPreambleDetectionWithFrameCapture::DoSetup(), TestThresholdPreambleDetectionWithoutFrameCapture::DoSetup(), DoSetup(), DoTeardown(), TestAmpduReception::SendAmpduWithThreeMpdus(), and SendPacket().
|
protected |
the UID to use for the PPDU
Definition at line 99 of file wifi-phy-reception-test.cc.
Referenced by TestAmpduReception::SendAmpduWithThreeMpdus(), and SendPacket().