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... | |
~BoxLineIntersectionTestCase () override | |
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 () 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... | |
void | DoRun () override |
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 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... | |
TestCase to check the box line intersection.
Definition at line 45 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 75 of file box-line-intersection-test.cc.
|
override |
Destructor.
Definition at line 87 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 92 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 121 of file box-line-intersection-test.cc.
References NS_FATAL_ERROR.
Referenced by DoRun().
|
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 107 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 91 of file box-line-intersection-test.h.
Referenced by DoRun().
|
private |
First position index.
Definition at line 89 of file box-line-intersection-test.h.
Referenced by DoRun().
|
private |
Second position index.
Definition at line 90 of file box-line-intersection-test.h.
Referenced by DoRun().
|
private |
Flag to indicate the intersection.
True, for intersection, false otherwise.
Definition at line 92 of file box-line-intersection-test.h.
Referenced by DoRun().