23 #include "ns3/core-module.h"
24 #include "ns3/network-module.h"
25 #include "ns3/internet-module.h"
26 #include "ns3/point-to-point-module.h"
27 #include "ns3/netanim-module.h"
28 #include "ns3/applications-module.h"
29 #include "ns3/point-to-point-layout-module.h"
30 #include "ns3/basic-energy-source.h"
31 #include "ns3/simple-device-energy-model.h"
74 TestCase (name), m_anim (NULL), m_traceFileName (
"netanim-test.xml")
136 pointToPoint.SetDeviceAttribute (
"DataRate",
StringValue (
"5Mbps"));
137 pointToPoint.SetChannelAttribute (
"Delay",
StringValue (
"2ms"));
140 devices = pointToPoint.Install (
m_nodes);
146 address.
SetBase (
"10.1.1.0",
"255.255.255.0");
153 serverApps.
Start (Seconds (1.0));
154 serverApps.
Stop (Seconds (10.0));
162 clientApps.
Start (Seconds (2.0));
163 clientApps.
Stop (Seconds (10.0));
195 m_initialEnergy (100)
208 m_energyModel->SetCurrentA (20);
222 const double remainingEnergy =
m_energySource->GetRemainingEnergy ();
228 "Wrong remaining energy value was traced");
holds a vector of ns3::Application pointers.
uint64_t GetTracePktCount()
Get trace file packet count (This used only for testing)
smart pointer class similar to boost::intrusive_ptr
ns3::AnimationInterfaceTestSuite g_animationInterfaceTestSuite
holds a vector of std::pair of Ptr and interface index.
hold variables of type string
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
Create an application which sends a UDP packet and waits for an echo of this packet.
static void Run(void)
Run the simulation until one of:
aggregate IP/TCP/UDP functionality to existing Nodes.
const double m_initialEnergy
#define NS_TEST_ASSERT_MSG_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal and report and abort if not...
Build a set of PointToPointNetDevice objects.
virtual ~AbstractAnimationInterfaceTestCase()
Destructor.
virtual void CheckLogic()
ApplicationContainer Install(Ptr< Node > node) const
Create a UdpEchoServerApplication on the specified Node.
static void SetConstantPosition(Ptr< Node > n, double x, double y, double z=0)
Helper function to set Constant Position for a given node.
virtual void PrepareNetwork()=0
Create a server application which waits for input UDP packets and sends them back to the original sen...
hold objects of type ns3::Time
AnimationInterfaceTestCase()
Constructor.
Hold an unsigned integer type.
double GetNodeEnergyFraction(Ptr< const Node > node) const
Get node's energy fraction (This used only for testing)
virtual void PrepareNetwork()
holds a vector of ns3::NetDevice pointers
Ptr< SimpleDeviceEnergyModel > m_energyModel
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
void AggregateObject(Ptr< Object > other)
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
keep track of a set of node pointers.
virtual void DoRun(void)
Run unit tests for this class.
const char * m_traceFileName
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
virtual void CheckLogic()
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter...
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
static void Stop(void)
If an event invokes this method, it will be the last event scheduled by the Simulator::run method bef...
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
AbstractAnimationInterfaceTestCase(std::string name)
Constructor.
AnimationInterface * m_anim
Interface to network animator.
virtual void CheckLogic()=0
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
This test suite implements a Unit Test.
AnimationRemainingEnergyTestCase()
Constructor.
Ptr< BasicEnergySource > m_energySource
virtual void PrepareNetwork()
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
virtual void CheckFileExistence()
#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.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
AnimationInterfaceTestSuite()