9#include "ns3/constant-position-mobility-model.h"
10#include "ns3/double.h"
12#include "ns3/propagation-loss-model.h"
13#include "ns3/simulator.h"
42 void DoRun()
override;
58 :
TestCase(
"Check to see that the ns-3 Friis propagation loss model provides correct received "
122 a->SetPosition(Vector(0, 0, 0));
135 "Got unexpected rcv power");
153 void DoRun()
override;
169 :
TestCase(
"Check to see that the ns-3 TwoRayGround propagation loss model provides correct "
263 a->SetPosition(Vector(0, 0, 0));
277 "Got unexpected rcv power");
293 void DoRun()
override;
309 :
TestCase(
"Check to see that the ns-3 Log Distance propagation loss model provides correct "
365 a->SetPosition(Vector(0, 0, 0));
379 "Got unexpected rcv power");
395 void DoRun()
override;
399 :
TestCase(
"Test MatrixPropagationLossModel")
411 for (
int i = 0;
i < 3; ++
i)
420 loss.SetLoss(m[0], m[1], 10);
422 loss.SetLoss(m[0], m[2], 30,
false);
423 loss.SetLoss(m[2], m[0], 100,
false);
448 void DoRun()
override;
452 :
TestCase(
"Test RangePropagationLossModel")
465 a->SetPosition(Vector(0, 0, 0));
467 b->SetPosition(Vector(127.1, 0, 0));
475 b->SetPosition(Vector(127.25, 0, 0));
FriisPropagationLossModel Test.
FriisPropagationLossModelTestCase()
~FriisPropagationLossModelTestCase() override
void DoRun() override
Implementation to actually run this TestCase.
TestVectors< TestVector > m_testVectors
Test vectors.
LogDistancePropagationLossModel Test.
TestVectors< TestVector > m_testVectors
Test vectors.
~LogDistancePropagationLossModelTestCase() override
LogDistancePropagationLossModelTestCase()
void DoRun() override
Implementation to actually run this TestCase.
MatrixPropagationLossModel Test.
void DoRun() override
Implementation to actually run this TestCase.
MatrixPropagationLossModelTestCase()
~MatrixPropagationLossModelTestCase() override
Propagation models TestSuite.
PropagationLossModelsTestSuite()
RangePropagationLossModel Test.
~RangePropagationLossModelTestCase() override
RangePropagationLossModelTestCase()
void DoRun() override
Implementation to actually run this TestCase.
TwoRayGroundPropagationLossModel Test.
TwoRayGroundPropagationLossModelTestCase()
~TwoRayGroundPropagationLossModelTestCase() override
TestVectors< TestVector > m_testVectors
Test vectors.
void DoRun() override
Implementation to actually run this TestCase.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
The propagation loss is fixed for each pair of nodes and doesn't depend on their actual positions.
void SetDefaultLoss(double defaultLoss)
Set the default propagation loss (in dB, positive) to be used, infinity if not set.
Smart pointer class similar to boost::intrusive_ptr.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
A simple way to store test vectors (for stimulus or from responses)
void SetDefault(std::string name, const AttributeValue &value)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
#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_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report if ...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static PropagationLossModelsTestSuite g_propagationLossModelsTestSuite
Static variable for test initialization.
Vector m_position
Test node position.
double m_pt
Tx power [dBm].
double m_tolerance
Tolerance.
double m_pt
Tx power [dBm].
double m_tolerance
Tolerance.
Vector m_position
Test node position.
double m_pt
Tx power [dBm].
double m_tolerance
Tolerance.
Vector m_position
Test node position.