20 #include "ns3/ipv4-address-generator.h"
21 #include "ns3/ipv4-address-helper.h"
22 #include "ns3/simulator.h"
37 virtual void DoRun (
void);
38 virtual void DoTeardown (
void);
42 :
TestCase (
"Make sure the network allocator part is working on some common network prefixes.")
50 Simulator::Destroy ();
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 virtual void DoRun (
void);
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");
141 virtual void DoRun (
void);
146 :
TestCase (
"Make sure the reset to base behavior is working")
162 h.
SetBase (
"1.0.0.0",
"255.0.0.0",
"0.0.0.3");
172 h.
SetBase (
"0.1.0.0",
"255.255.0.0",
"0.0.0.3");
182 h.
SetBase (
"0.0.1.0",
"255.255.255.0",
"0.0.0.3");
197 Simulator::Destroy ();
213 virtual void DoRun (
void);
218 :
TestCase (
"IpAddressHelper Ipv4 test case (similar to IPv6)")
235 ip1.
SetBase (
"192.168.0.0",
"255.255.255.0");
252 ip1.
SetBase (
"192.168.0.0",
"255.255.255.0",
"0.0.0.100");
257 ip1.
SetBase (
"192.168.0.0",
"255.255.255.0",
"0.0.0.254");
278 Simulator::Destroy ();
296 :
TestSuite (
"ipv4-address-helper", UNIT)
IPv4 address allocator helper Test.
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase.
virtual void DoRun(void)
Implementation to actually run this TestCase.
AddressAllocatorHelperTestCase()
IPv4 address helper Test.
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual ~IpAddressHelperTestCasev4()
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase.
IpAddressHelperTestCasev4()
IPv4 Address Helper TestSuite.
Ipv4AddressHelperTestSuite()
IPv4 network allocator helper Test.
NetworkAllocatorHelperTestCase()
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase.
virtual void DoRun(void)
Implementation to actually run this TestCase.
IPv4 reset allocator helper Test.
virtual void DoRun(void)
Implementation to actually run this TestCase.
ResetAllocatorHelperTestCase()
virtual void DoTeardown(void)
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 NewNetwork(void)
Increment the network number and reset the IP address counter to the base value provided in the SetBa...
Ipv4Address NewAddress(void)
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.
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(void)
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.