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. | |
| ~BoxLineIntersectionTestCase () override | |
| Destructor. | |
| std::string | BuildNameString (uint16_t indexPos1, uint16_t indexPos2, Box box, bool intersect) |
| Builds the test name string based on provided parameter values. | |
Public Member Functions inherited from ns3::TestCase | |
| TestCase (const TestCase &)=delete | |
| virtual | ~TestCase () |
| Destructor. | |
| 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. | |
| void | DoRun () override |
| Setup the simulation according to the configuration set by the class constructor, run it, and verify the result. | |
Private Attributes | |
| Box | m_box |
| The box to check the intersection with. | |
| uint16_t | m_indexPos1 {0} |
| First position index. | |
| uint16_t | m_indexPos2 {0} |
| Second position index. | |
| bool | m_intersect {false} |
| Flag to indicate the intersection. | |
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. | |
| void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
| Add an individual child TestCase to this test suite. | |
| TestCase * | GetParent () const |
| Get the parent of this TestCase. | |
| bool | IsStatusFailure () const |
| Check if any tests failed. | |
| bool | IsStatusSuccess () const |
| Check if all tests passed. | |
| void | SetDataDir (std::string directory) |
| Set the data directory where reference trace files can be found. | |
| 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. | |
| bool | MustAssertOnFailure () const |
| Check if this run should assert on failure. | |
| bool | MustContinueOnFailure () const |
| Check if this run should continue on failure. | |
| std::string | CreateDataDirFilename (std::string filename) |
| Construct the full path to a file in the data directory. | |
| std::string | CreateTempDirFilename (std::string filename) |
| Construct the full path to a file in a temporary directory. | |
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().
Here is the caller graph for this function:
|
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::Simulator::Destroy(), 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:
|
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().