A Discrete-Event Network Simulator
API
BoxLineIntersectionTestCase Class Reference

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

#include "box-line-intersection-test.h"

+ Inheritance diagram for BoxLineIntersectionTestCase:
+ Collaboration diagram for BoxLineIntersectionTestCase:

Public Member Functions

 BoxLineIntersectionTestCase (uint16_t indexPos1, uint16_t indexPos2, Box box, bool intersect)
 Create BoxLineIntersectionTestCase. More...
 
virtual ~BoxLineIntersectionTestCase ()
 Destructor. More...
 
std::string BuildNameString (uint16_t indexPos1, uint16_t indexPos2, Box box, bool intersect)
 Builds the test name string based on provided parameter values. More...
 
- Public Member Functions inherited from ns3::TestCase
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName (void) const
 

Private Member Functions

Vector CreatePosition (uint16_t index, double boxHeight)
 Create the position as per the given index. More...
 
virtual void DoRun (void)
 Setup the simulation according to the configuration set by the class constructor, run it, and verify the result. More...
 

Private Attributes

Box m_box
 The box to check the intersection with. More...
 
uint16_t m_indexPos1 {0}
 First position index. More...
 
uint16_t m_indexPos2 {0}
 Second position index. More...
 
bool m_intersect {false}
 Flag to indicate the intersection. 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 TestCsse. More...
 
bool IsStatusFailure (void) const
 Check if any tests failed. More...
 
bool IsStatusSuccess (void) 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 (void) const
 Check if this run should assert on failure. More...
 
bool MustContinueOnFailure (void) 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 box line intersection.

Definition at line 47 of file box-line-intersection-test.h.

Constructor & Destructor Documentation

◆ BoxLineIntersectionTestCase()

BoxLineIntersectionTestCase::BoxLineIntersectionTestCase ( uint16_t  indexPos1,
uint16_t  indexPos2,
Box  box,
bool  intersect 
)

Create BoxLineIntersectionTestCase.

TestCase.

Parameters
indexPos1Index of the first position to generate
indexPos2Index of the second position to generate
boxThe 3D box
intersectThe expected result of the test. True for intersection, false otherwise

Definition at line 77 of file box-line-intersection-test.cc.

◆ ~BoxLineIntersectionTestCase()

BoxLineIntersectionTestCase::~BoxLineIntersectionTestCase ( )
virtual

Destructor.

Definition at line 86 of file box-line-intersection-test.cc.

Member Function Documentation

◆ BuildNameString()

std::string BoxLineIntersectionTestCase::BuildNameString ( uint16_t  indexPos1,
uint16_t  indexPos2,
Box  box,
bool  intersect 
)

Builds the test name string based on provided parameter values.

Parameters
indexPos1Index of the first position to generate
indexPos2Index of the second position to generate
boxThe 3D box
intersectThe expected result of the test. True for intersection, false otherwise
Returns
The name string

Definition at line 91 of file box-line-intersection-test.cc.

References ns3::Box::xMax, ns3::Box::xMin, ns3::Box::yMax, ns3::Box::yMin, ns3::Box::zMax, and ns3::Box::zMin.

◆ CreatePosition()

Vector BoxLineIntersectionTestCase::CreatePosition ( uint16_t  index,
double  boxHeight 
)
private

Create the position as per the given index.

Parameters
indexThe index of the position to be created
boxHeightThe height if the box. It is used to place the position above the height of the box
Returns
The ns-3 3D Vector specifying the position

Definition at line 117 of file box-line-intersection-test.cc.

References NS_FATAL_ERROR.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ DoRun()

void BoxLineIntersectionTestCase::DoRun ( void  )
privatevirtual

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

Implements ns3::TestCase.

Definition at line 104 of file box-line-intersection-test.cc.

References CreatePosition(), ns3::Box::IsIntersect(), m_box, m_indexPos1, m_indexPos2, m_intersect, NS_TEST_ASSERT_MSG_EQ, ns3::Box::zMax, and ns3::Box::zMin.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_box

Box BoxLineIntersectionTestCase::m_box
private

The box to check the intersection with.

Definition at line 93 of file box-line-intersection-test.h.

Referenced by DoRun().

◆ m_indexPos1

uint16_t BoxLineIntersectionTestCase::m_indexPos1 {0}
private

First position index.

Definition at line 91 of file box-line-intersection-test.h.

Referenced by DoRun().

◆ m_indexPos2

uint16_t BoxLineIntersectionTestCase::m_indexPos2 {0}
private

Second position index.

Definition at line 92 of file box-line-intersection-test.h.

Referenced by DoRun().

◆ m_intersect

bool BoxLineIntersectionTestCase::m_intersect {false}
private

Flag to indicate the intersection.

True, for intersection, false otherwise.

Definition at line 94 of file box-line-intersection-test.h.

Referenced by DoRun().


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