This test case tests channel access assignments which is done by StartSch and StopSch method of WaveNetDevice. More...
Public Member Functions | |
ChannelAccessTestCase () | |
~ChannelAccessTestCase () override | |
![]() | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | DoRun () override |
Implementation to actually run this TestCase. More... | |
bool | Receive (Ptr< NetDevice > dev, Ptr< const Packet > pkt, uint16_t mode, const Address &sender) |
Receive function. More... | |
void | SendX (uint32_t channel, uint32_t receiverId) |
Send X function. More... | |
void | TestAlternating (SchInfo &info, bool shouldSucceed) |
Test aternating function. More... | |
void | TestAlternatingAfter (uint32_t channelNumber, bool isAccessAssigned) |
Test alternating after function. More... | |
void | TestContinuous (SchInfo &info, bool shouldSucceed) |
Test continuous function. More... | |
void | TestContinuousAfter (uint32_t channelNumber, bool isAccessAssigned) |
Test continuous after function. More... | |
void | TestExtended (SchInfo &info, bool shouldSucceed) |
Test extended function. More... | |
void | TestExtendedAfter (uint32_t channelNumber, bool isAccessAssigned) |
Test extended after function. More... | |
Private Attributes | |
NetDeviceContainer | m_devices |
the devices More... | |
uint32_t | m_received |
received More... | |
Ptr< WaveNetDevice > | m_sender |
sender More... | |
Additional Inherited Members | |
![]() | |
enum | TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
![]() | |
TestCase (std::string name) | |
Constructor. More... | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. More... | |
TestCase * | GetParent () const |
Get the parent of this TestCase. More... | |
bool | IsStatusFailure () const |
Check if any tests failed. More... | |
bool | IsStatusSuccess () const |
Check if all tests passed. More... | |
void | SetDataDir (std::string directory) |
Set the data directory where reference trace files can be found. More... | |
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. More... | |
bool | MustAssertOnFailure () const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure () const |
Check if this run should continue on failure. More... | |
std::string | CreateDataDirFilename (std::string filename) |
Construct the full path to a file in the data directory. More... | |
std::string | CreateTempDirFilename (std::string filename) |
Construct the full path to a file in a temporary directory. More... | |
This test case tests channel access assignments which is done by StartSch and StopSch method of WaveNetDevice.
channel access assignments include ContinuousAccess, ExtendedAccess, and AlternatingAccess. The results of this test case depend on the implementation of ChannelScheduler In this case, the results depend on class "DefaultChannelScheduler".
Definition at line 754 of file mac-extension-test-suite.cc.
ChannelAccessTestCase::ChannelAccessTestCase | ( | ) |
Definition at line 821 of file mac-extension-test-suite.cc.
|
override |
Definition at line 826 of file mac-extension-test-suite.cc.
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 953 of file mac-extension-test-suite.cc.
References CCH, third::channel, TestCaseHelper::CreatWaveDevice(), EXTENDED_ALTERNATING, EXTENDED_CONTINUOUS, ns3::NetDeviceContainer::Get(), m_devices, m_received, m_sender, ns3::MakeCallback(), NS_TEST_EXPECT_MSG_EQ, Receive(), SCH1, SCH2, SCH3, SCH4, SCH5, SCH6, ns3::Seconds(), SendX(), ns3::WaveNetDevice::SetReceiveCallback(), TestAlternating(), TestAlternatingAfter(), TestContinuous(), TestContinuousAfter(), TestExtended(), and TestExtendedAfter().
|
private |
Receive function.
dev | the device |
pkt | the packet |
mode | the mode |
sender | the sender address |
Definition at line 909 of file mac-extension-test-suite.cc.
References ns3::Packet::CopyData(), data, ns3::Packet::GetSize(), m_received, and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoRun().
|
private |
Send X function.
channel | the channel number |
receiverId |
Definition at line 879 of file mac-extension-test-suite.cc.
References third::channel, data, ns3::Time::GetTimeStep(), m_sender, ns3::Now(), and ns3::WaveNetDevice::SendX().
Referenced by DoRun().
|
private |
Test aternating function.
info | the schedule info |
shouldSucceed | true if it should succeed |
Definition at line 863 of file mac-extension-test-suite.cc.
References m_sender, ns3::Now(), NS_TEST_EXPECT_MSG_EQ, and ns3::WaveNetDevice::StartSch().
Referenced by DoRun().
|
private |
Test alternating after function.
channelNumber | the channel number |
isAccessAssigned | true if access assigned |
Definition at line 870 of file mac-extension-test-suite.cc.
References ns3::WaveNetDevice::GetChannelScheduler(), m_sender, ns3::Now(), and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoRun().
|
private |
Test continuous function.
info | the schedule info |
shouldSucceed | true if it should succeed |
Definition at line 831 of file mac-extension-test-suite.cc.
References m_sender, ns3::Now(), NS_TEST_EXPECT_MSG_EQ, and ns3::WaveNetDevice::StartSch().
Referenced by DoRun().
|
private |
Test continuous after function.
channelNumber | the channel number |
isAccessAssigned | true if access assigned |
Definition at line 838 of file mac-extension-test-suite.cc.
References ns3::WaveNetDevice::GetChannelScheduler(), m_sender, ns3::Now(), and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoRun().
|
private |
Test extended function.
info | the schedule info |
shouldSucceed | true if it should succeed |
Definition at line 847 of file mac-extension-test-suite.cc.
References m_sender, ns3::Now(), NS_TEST_EXPECT_MSG_EQ, and ns3::WaveNetDevice::StartSch().
Referenced by DoRun().
|
private |
Test extended after function.
channelNumber | the channel number |
isAccessAssigned | true if access assigned |
Definition at line 854 of file mac-extension-test-suite.cc.
References ns3::WaveNetDevice::GetChannelScheduler(), m_sender, ns3::Now(), and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoRun().
|
private |
|
private |
received
Definition at line 818 of file mac-extension-test-suite.cc.
|
private |
sender
Definition at line 817 of file mac-extension-test-suite.cc.
Referenced by DoRun(), SendX(), TestAlternating(), TestAlternatingAfter(), TestContinuous(), TestContinuousAfter(), TestExtended(), and TestExtendedAfter().