18 #include "ns3/ipv4-address-generator.h"
19 #include "ns3/ipv4-address-helper.h"
20 #include "ns3/simulator.h"
36 void DoRun()
override;
37 void DoTeardown()
override;
41 :
TestCase(
"Make sure the network allocator part is working on some common network prefixes.")
59 h.
SetBase(
"1.0.0.0",
"255.0.0.0");
65 h.
SetBase(
"0.1.0.0",
"255.255.0.0");
71 h.
SetBase(
"0.0.1.0",
"255.255.255.0");
89 void DoRun()
override;
94 :
TestCase(
"Make sure the address allocator part is working")
102 Simulator::Destroy();
112 h.
SetBase(
"1.0.0.0",
"255.0.0.0",
"0.0.0.3");
118 h.
SetBase(
"0.1.0.0",
"255.255.0.0",
"0.0.0.3");
124 h.
SetBase(
"0.0.1.0",
"255.255.255.0",
"0.0.0.3");
140 void DoRun()
override;
145 :
TestCase(
"Make sure the reset to base behavior is working")
161 h.
SetBase(
"1.0.0.0",
"255.0.0.0",
"0.0.0.3");
171 h.
SetBase(
"0.1.0.0",
"255.255.0.0",
"0.0.0.3");
181 h.
SetBase(
"0.0.1.0",
"255.255.255.0",
"0.0.0.3");
196 Simulator::Destroy();
211 void DoRun()
override;
216 :
TestCase(
"IpAddressHelper Ipv4 test case (similar to IPv6)")
233 ip1.
SetBase(
"192.168.0.0",
"255.255.255.0");
250 ip1.
SetBase(
"192.168.0.0",
"255.255.255.0",
"0.0.0.100");
255 ip1.
SetBase(
"192.168.0.0",
"255.255.255.0",
"0.0.0.254");
275 Simulator::Destroy();
IPv4 address allocator helper Test.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
void DoRun() override
Implementation to actually run this TestCase.
AddressAllocatorHelperTestCase()
IPv4 address helper Test.
~IpAddressHelperTestCasev4() override
IpAddressHelperTestCasev4()
void DoRun() override
Implementation to actually run this TestCase.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
IPv4 Address Helper TestSuite.
Ipv4AddressHelperTestSuite()
IPv4 network allocator helper Test.
void DoRun() override
Implementation to actually run this TestCase.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
NetworkAllocatorHelperTestCase()
IPv4 reset allocator helper Test.
void DoRun() override
Implementation to actually run this TestCase.
ResetAllocatorHelperTestCase()
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Ipv4Address NewAddress()
Increment the IP address counter used to allocate IP addresses.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Ipv4Address NewNetwork()
Increment the network number and reset the IP address counter to the base value provided in the SetBa...
Ipv4 addresses are stored in host order in this class.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
void Reset()
Reset the initial value of every attribute as well as the value of every global to what they were bef...
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
static Ipv4AddressHelperTestSuite g_ipv4AddressHelperTestSuite
Static variable for test initialization.
Every class exported by the ns3 library is enclosed in the ns3 namespace.