TestCase to check the box line intersection. More...
#include "box-line-intersection-test.h"
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 | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName (void) const |
TestCase & | operator= (const TestCase &)=delete |
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... | |
TestCase * | GetParent () 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... | |
TestCase to check the box line intersection.
Definition at line 47 of file box-line-intersection-test.h.
BoxLineIntersectionTestCase::BoxLineIntersectionTestCase | ( | uint16_t | indexPos1, |
uint16_t | indexPos2, | ||
Box | box, | ||
bool | intersect | ||
) |
Create BoxLineIntersectionTestCase.
TestCase.
indexPos1 | Index of the first position to generate |
indexPos2 | Index of the second position to generate |
box | The 3D box |
intersect | The expected result of the test. True for intersection, false otherwise |
Definition at line 77 of file box-line-intersection-test.cc.
|
virtual |
Destructor.
Definition at line 86 of file box-line-intersection-test.cc.
std::string BoxLineIntersectionTestCase::BuildNameString | ( | uint16_t | indexPos1, |
uint16_t | indexPos2, | ||
Box | box, | ||
bool | intersect | ||
) |
Builds the test name string based on provided parameter values.
indexPos1 | Index of the first position to generate |
indexPos2 | Index of the second position to generate |
box | The 3D box |
intersect | The expected result of the test. True for intersection, false otherwise |
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.
|
private |
Create the position as per the given index.
index | The index of the position to be created |
boxHeight | The height if the box. It is used to place the position above the height of the box |
Definition at line 117 of file box-line-intersection-test.cc.
References NS_FATAL_ERROR.
Referenced by DoRun().
|
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.
|
private |
The box to check the intersection with.
Definition at line 93 of file box-line-intersection-test.h.
Referenced by DoRun().
|
private |
First position index.
Definition at line 91 of file box-line-intersection-test.h.
Referenced by DoRun().
|
private |
Second position index.
Definition at line 92 of file box-line-intersection-test.h.
Referenced by DoRun().
|
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().