A Discrete-Event Network Simulator
API
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TcFlowControlTestCase Class Reference

Traffic Control Flow Control Test Case. More...

+ Inheritance diagram for TcFlowControlTestCase:

Public Member Functions

 TcFlowControlTestCase (QueueSizeUnit tt)
 Constructor. More...
 
virtual ~TcFlowControlTestCase ()
 
- Public Member Functions inherited from ns3::TestCase
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName (void) const
 

Private Member Functions

void CheckDeviceQueueStopped (Ptr< NetDevice > dev, bool value, const char *msg)
 Check if the device queue is in the expected status (stopped or not) More...
 
void CheckPacketsInDeviceQueue (Ptr< NetDevice > dev, uint16_t nPackets, const char *msg)
 Check if the device queue stores the expected number of packets. More...
 
void CheckPacketsInQueueDisc (Ptr< NetDevice > dev, uint16_t nPackets, const char *msg)
 Check if the queue disc stores the expected number of packets. More...
 
virtual void DoRun (void)
 Implementation to actually run this TestCase. More...
 
void SendPackets (Ptr< Node > n, uint16_t nPackets)
 Instruct a node to send a specified number of packets. More...
 

Private Attributes

QueueSizeUnit m_type
 the test type 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...
 
TestCaseGetParent () 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...
 

Detailed Description

Traffic Control Flow Control Test Case.

Definition at line 99 of file tc-flow-control-test-suite.cc.

Constructor & Destructor Documentation

◆ TcFlowControlTestCase()

TcFlowControlTestCase::TcFlowControlTestCase ( QueueSizeUnit  tt)

Constructor.

Parameters
ttthe test type

Definition at line 141 of file tc-flow-control-test-suite.cc.

◆ ~TcFlowControlTestCase()

TcFlowControlTestCase::~TcFlowControlTestCase ( )
virtual

Definition at line 147 of file tc-flow-control-test-suite.cc.

Member Function Documentation

◆ CheckDeviceQueueStopped()

void TcFlowControlTestCase::CheckDeviceQueueStopped ( Ptr< NetDevice dev,
bool  value,
const char *  msg 
)
private

Check if the device queue is in the expected status (stopped or not)

Parameters
devthe device
valuethe expected status of the queue (true means stopped)
msgthe message to print if the status of the device queue is different

Definition at line 171 of file tc-flow-control-test-suite.cc.

References ns3::Object::GetObject(), ns3::NetDeviceQueueInterface::GetTxQueue(), and NS_TEST_EXPECT_MSG_EQ.

Referenced by DoRun().

◆ CheckPacketsInDeviceQueue()

void TcFlowControlTestCase::CheckPacketsInDeviceQueue ( Ptr< NetDevice dev,
uint16_t  nPackets,
const char *  msg 
)
private

Check if the device queue stores the expected number of packets.

Parameters
devthe device
nPacketsthe expected number of packets stored in the device queue
msgthe message to print if a different number of packets are stored

Definition at line 162 of file tc-flow-control-test-suite.cc.

References ns3::PointerValue::Get(), ns3::ObjectBase::GetAttributeFailSafe(), and NS_TEST_EXPECT_MSG_EQ.

Referenced by DoRun().

◆ CheckPacketsInQueueDisc()

void TcFlowControlTestCase::CheckPacketsInQueueDisc ( Ptr< NetDevice dev,
uint16_t  nPackets,
const char *  msg 
)
private

Check if the queue disc stores the expected number of packets.

Parameters
devthe device the queue disc is installed on
nPacketsthe expected number of packets stored in the queue disc
msgthe message to print if a different number of packets are stored

Definition at line 178 of file tc-flow-control-test-suite.cc.

References ns3::NetDevice::GetNode(), ns3::Object::GetObject(), ns3::TrafficControlLayer::GetRootQueueDiscOnDevice(), and NS_TEST_EXPECT_MSG_EQ.

Referenced by DoRun().

◆ DoRun()

void TcFlowControlTestCase::DoRun ( void  )
privatevirtual

◆ SendPackets()

void TcFlowControlTestCase::SendPackets ( Ptr< Node n,
uint16_t  nPackets 
)
private

Instruct a node to send a specified number of packets.

Parameters
nthe node
nPacketsthe number of packets to send

Definition at line 152 of file tc-flow-control-test-suite.cc.

References sample-rng-plot::n, and ns3::TrafficControlLayer::Send().

Referenced by DoRun().

Member Data Documentation

◆ m_type

QueueSizeUnit TcFlowControlTestCase::m_type
private

the test type

Definition at line 138 of file tc-flow-control-test-suite.cc.

Referenced by DoRun().


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