20 #include "ns3/ascii-test.h"
21 #include "ns3/double.h"
22 #include "ns3/mobility-helper.h"
23 #include "ns3/mobility-model.h"
24 #include "ns3/node-container.h"
25 #include "ns3/rectangle.h"
26 #include "ns3/simulator.h"
27 #include "ns3/string.h"
29 #include "ns3/trace-helper.h"
30 #include "ns3/uinteger.h"
49 void DoRun()
override;
53 :
TestCase(
"Mobility Trace Test Case")
71 mobility.SetPositionAllocator(
"ns3::GridPositionAllocator",
84 mobility.SetMobilityModel(
"ns3::RandomWalk2dMobilityModel",
90 StringValue(
"ns3::ConstantRandomVariable[Constant=1.0]"),
92 RectangleValue(
Rectangle(0.0, 20.0, 0.0, 20.0)));
102 MobilityHelper::EnableAsciiAll(ascii.
CreateFileStream(testMobilityFilePath));
105 Simulator::Destroy();
#define NS_ASCII_TEST_EXPECT_EQ(gotFilename, expectedFilename)
Test that a pair of new/reference ascii files are equal.
Mobility Trace Test Case.
void DoRun() override
Implementation to actually run this TestCase.
~MobilityTraceTestCase() override
Mobility Trace Test Suite.
Manage ASCII trace files for device models.
Ptr< OutputStreamWrapper > CreateFileStream(std::string filename, std::ios::openmode filemode=std::ios::out)
Create and initialize an output stream object we'll use to write the traced bits.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Helper class used to assign positions and mobility models to nodes.
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Hold variables of type string.
std::string CreateDataDirFilename(std::string filename)
Construct the full path to a file in the data directory.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
std::string CreateTempDirFilename(std::string filename)
Construct the full path to a file in a temporary directory.
void SetDataDir(std::string directory)
Set the data directory where reference trace files can be found.
Hold an unsigned integer type.
static MobilityTraceTestSuite mobilityTraceTestSuite
Static variable for test initialization.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.