This test case tests channel access assignments which is done by StartSch and StopSch method of WaveNetDevice. More...
Public Member Functions | |
ChannelAccessTestCase (void) | |
virtual | ~ChannelAccessTestCase (void) |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName (void) const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
virtual void | DoRun (void) |
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 | |
Public Types inherited from ns3::TestCase | |
enum | TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
Protected Member Functions inherited from ns3::TestCase | |
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 TestCsse. More... | |
bool | IsStatusFailure (void) const |
Check if any tests failed. More... | |
bool | IsStatusSuccess (void) 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 (void) const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure (void) 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 534 of file mac-extension-test-suite.cc.
ChannelAccessTestCase::ChannelAccessTestCase | ( | void | ) |
Definition at line 600 of file mac-extension-test-suite.cc.
|
virtual |
Definition at line 604 of file mac-extension-test-suite.cc.
|
privatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 718 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 677 of file mac-extension-test-suite.cc.
References ns3::Packet::CopyData(), data, ns3::Node::GetId(), ns3::NetDevice::GetNode(), 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 647 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 634 of file mac-extension-test-suite.cc.
References m_sender, ns3::Now(), NS_TEST_EXPECT_MSG_EQ, test-ns3::result, and ns3::WaveNetDevice::StartSch().
Referenced by DoRun().
|
private |
Test alternating after function.
channelNumber | the channel number |
isAccessAssigned | true if access assigned |
Definition at line 640 of file mac-extension-test-suite.cc.
References ns3::WaveNetDevice::GetChannelScheduler(), m_sender, ns3::Now(), NS_TEST_EXPECT_MSG_EQ, and test-ns3::result.
Referenced by DoRun().
|
private |
Test continuous function.
info | the schedule info |
shouldSucceed | true if it should succeed |
Definition at line 609 of file mac-extension-test-suite.cc.
References m_sender, ns3::Now(), NS_TEST_EXPECT_MSG_EQ, test-ns3::result, and ns3::WaveNetDevice::StartSch().
Referenced by DoRun().
|
private |
Test continuous after function.
channelNumber | the channel number |
isAccessAssigned | true if access assigned |
Definition at line 615 of file mac-extension-test-suite.cc.
References ns3::WaveNetDevice::GetChannelScheduler(), m_sender, ns3::Now(), NS_TEST_EXPECT_MSG_EQ, and test-ns3::result.
Referenced by DoRun().
|
private |
Test extended function.
info | the schedule info |
shouldSucceed | true if it should succeed |
Definition at line 621 of file mac-extension-test-suite.cc.
References m_sender, ns3::Now(), NS_TEST_EXPECT_MSG_EQ, test-ns3::result, and ns3::WaveNetDevice::StartSch().
Referenced by DoRun().
|
private |
Test extended after function.
channelNumber | the channel number |
isAccessAssigned | true if access assigned |
Definition at line 627 of file mac-extension-test-suite.cc.
References ns3::WaveNetDevice::GetChannelScheduler(), m_sender, ns3::Now(), NS_TEST_EXPECT_MSG_EQ, and test-ns3::result.
Referenced by DoRun().
|
private |
|
private |
received
Definition at line 597 of file mac-extension-test-suite.cc.
|
private |
sender
Definition at line 596 of file mac-extension-test-suite.cc.
Referenced by DoRun(), SendX(), TestAlternating(), TestAlternatingAfter(), TestContinuous(), TestContinuousAfter(), TestExtended(), and TestExtendedAfter().