The topology is of the form: More...
Public Member Functions | |
NixVectorRoutingTest () | |
void | DoRun () override |
Implementation to actually run this TestCase. | |
void | ReceivePkt (Ptr< Socket > socket) |
Receive data. | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Public Attributes | |
std::vector< uint32_t > | m_receivedPacketSizes |
Received packet sizes. | |
Private Member Functions | |
void | DoSendDatav4 (Ptr< Socket > socket, Ipv4Address to) |
Send data immediately after being called. | |
void | DoSendDatav6 (Ptr< Socket > socket, Ipv6Address to) |
Send data immediately after being called. | |
void | SendData (Time delay, Ptr< Socket > socket, Ipv4Address to) |
Schedules the DoSendData () function to send the data. | |
void | SendData (Time delay, Ptr< Socket > socket, Ipv6Address to) |
Schedules the DoSendData () function to send the data. | |
Private Attributes | |
Ptr< Packet > | m_receivedPacket |
Received packet. | |
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. | |
The topology is of the form:
__________ / \ nSrc -- nA -- nB -- nC -- nDst
Following are the tests in this test case:
IPv4 Nix-Vector Routing Test
Definition at line 54 of file nix-test.cc.
NixVectorRoutingTest::NixVectorRoutingTest | ( | ) |
Definition at line 101 of file nix-test.cc.
|
overridevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 156 of file nix-test.cc.
References ns3::NodeContainer::Add(), ns3::Ipv4AddressHelper::Assign(), ns3::Ipv6AddressHelper::Assign(), ns3::Create(), ns3::NodeContainer::Create(), ns3::Simulator::Destroy(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::Ipv4InterfaceContainer::GetAddress(), ns3::Ipv6InterfaceContainer::GetAddress(), ns3::Object::GetObject(), ns3::SimpleNetDeviceHelper::Install(), m_receivedPacketSizes, ns3::MakeCallback(), NS_TEST_EXPECT_MSG_EQ, ns3::NixVectorHelper< T >::PrintRoutingPathAt(), ReceivePkt(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), SendData(), ns3::Ipv4AddressHelper::SetBase(), ns3::Ipv6AddressHelper::SetBase(), ns3::Ipv4::SetDown(), ns3::Ipv6::SetDown(), ns3::SimpleNetDeviceHelper::SetNetDevicePointToPointMode(), and ns3::Simulator::Stop().
|
private |
Send data immediately after being called.
socket | The sending socket. |
to | IPv4 Destination address. |
Definition at line 118 of file nix-test.cc.
References ns3::Create().
Referenced by SendData().
|
private |
Send data immediately after being called.
socket | The sending socket. |
to | IPv6 Destination address. |
Definition at line 125 of file nix-test.cc.
References ns3::Create().
Referenced by SendData().
Receive data.
socket | The receiving socket. |
Definition at line 107 of file nix-test.cc.
References ns3::Packet::GetSize(), m_receivedPacket, m_receivedPacketSizes, and NS_TEST_ASSERT_MSG_EQ.
Referenced by DoRun().
|
private |
Schedules the DoSendData () function to send the data.
delay | The scheduled time to send data. |
socket | The sending socket. |
to | IPv4 Destination address. |
Definition at line 132 of file nix-test.cc.
References ns3::Create(), DoSendDatav4(), m_receivedPacket, and ns3::Simulator::ScheduleWithContext().
Referenced by DoRun().
|
private |
Schedules the DoSendData () function to send the data.
delay | The scheduled time to send data. |
socket | The sending socket. |
to | IPv6 Destination address. |
Definition at line 144 of file nix-test.cc.
References ns3::Create(), DoSendDatav6(), m_receivedPacket, and ns3::Simulator::ScheduleWithContext().
Received packet.
Definition at line 56 of file nix-test.cc.
Referenced by ReceivePkt(), SendData(), and SendData().
std::vector<uint32_t> NixVectorRoutingTest::m_receivedPacketSizes |
Received packet sizes.
Definition at line 98 of file nix-test.cc.
Referenced by DoRun(), and ReceivePkt().