A Discrete-Event Network Simulator
API
RectangleClosestBorderTestCase Class Reference

TestCase to check the rectangle line intersection. More...

+ Inheritance diagram for RectangleClosestBorderTestCase:
+ Collaboration diagram for RectangleClosestBorderTestCase:

Public Member Functions

 RectangleClosestBorderTestCase (double x, double y, Rectangle rectangle, Rectangle::Side side)
 Create RectangleClosestBorderTestCase. More...
 
 ~RectangleClosestBorderTestCase () override
 Destructor. More...
 
std::string BuildNameString (double x, double y, Rectangle rectangle, Rectangle::Side side)
 Builds the test name string based on provided parameter values. More...
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

void DoRun () override
 Setup the simulation according to the configuration set by the class constructor, run it, and verify the result. More...
 

Private Attributes

Rectangle m_rectangle
 The rectangle to check the intersection with. More...
 
Rectangle::Side m_side {ns3::Rectangle::TOPSIDE}
 Flag to indicate the intersection. More...
 
double m_x {0.0}
 X coordinate of the point to be tested. More...
 
double m_y {0.0}
 Y coordinate of the point to be tested. More...
 

Additional Inherited Members

- Public Types inherited from ns3::TestCase
enum  TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 
- Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor. More...
 
void AddTestCase (TestCase *testCase, TestDuration duration=QUICK)
 Add an individual child TestCase to this test suite. More...
 
TestCaseGetParent () const
 Get the parent of this TestCase. More...
 
bool IsStatusFailure () const
 Check if any tests failed. More...
 
bool IsStatusSuccess () const
 Check if all tests passed. More...
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found. More...
 
void ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line)
 Log the failure of this TestCase. More...
 
bool MustAssertOnFailure () const
 Check if this run should assert on failure. More...
 
bool MustContinueOnFailure () const
 Check if this run should continue on failure. More...
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory. More...
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory. More...
 

Detailed Description

TestCase to check the rectangle line intersection.

Definition at line 43 of file rectangle-closest-border-test.cc.

Constructor & Destructor Documentation

◆ RectangleClosestBorderTestCase()

RectangleClosestBorderTestCase::RectangleClosestBorderTestCase ( double  x,
double  y,
Rectangle  rectangle,
Rectangle::Side  side 
)

Create RectangleClosestBorderTestCase.

Parameters
xIndex of the first position to generate
yIndex of the second position to generate
rectangleThe 2D rectangle
sideThe expected result of the test

Definition at line 169 of file rectangle-closest-border-test.cc.

◆ ~RectangleClosestBorderTestCase()

RectangleClosestBorderTestCase::~RectangleClosestBorderTestCase ( )
override

Destructor.

Definition at line 181 of file rectangle-closest-border-test.cc.

Member Function Documentation

◆ BuildNameString()

std::string RectangleClosestBorderTestCase::BuildNameString ( double  x,
double  y,
Rectangle  rectangle,
Rectangle::Side  side 
)

Builds the test name string based on provided parameter values.

Parameters
xIndex of the first position to generate
yIndex of the second position to generate
rectangleThe 2D rectangle
sideThe expected result of the test
Returns
The name string

Definition at line 186 of file rectangle-closest-border-test.cc.

References two-ray-to-three-gpp-ch-calibration::x, ns3::Rectangle::xMax, ns3::Rectangle::xMin, ns3::Rectangle::yMax, and ns3::Rectangle::yMin.

◆ DoRun()

void RectangleClosestBorderTestCase::DoRun ( void  )
overrideprivatevirtual

Setup the simulation according to the configuration set by the class constructor, run it, and verify the result.

Implements ns3::TestCase.

Definition at line 200 of file rectangle-closest-border-test.cc.

References ns3::Rectangle::GetClosestSideOrCorner(), m_rectangle, m_side, m_x, m_y, and NS_TEST_ASSERT_MSG_EQ.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_rectangle

Rectangle RectangleClosestBorderTestCase::m_rectangle
private

The rectangle to check the intersection with.

Definition at line 78 of file rectangle-closest-border-test.cc.

Referenced by DoRun().

◆ m_side

Rectangle::Side RectangleClosestBorderTestCase::m_side {ns3::Rectangle::TOPSIDE}
private

Flag to indicate the intersection.

True, for intersection, false otherwise.

Definition at line 84 of file rectangle-closest-border-test.cc.

Referenced by DoRun().

◆ m_x

double RectangleClosestBorderTestCase::m_x {0.0}
private

X coordinate of the point to be tested.

Definition at line 76 of file rectangle-closest-border-test.cc.

Referenced by DoRun().

◆ m_y

double RectangleClosestBorderTestCase::m_y {0.0}
private

Y coordinate of the point to be tested.

Definition at line 77 of file rectangle-closest-border-test.cc.

Referenced by DoRun().


The documentation for this class was generated from the following file: