TestCase to check the rectangle line intersection. More...
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 |
TestCase & | operator= (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... | |
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 rectangle line intersection.
Definition at line 43 of file rectangle-closest-border-test.cc.
RectangleClosestBorderTestCase::RectangleClosestBorderTestCase | ( | double | x, |
double | y, | ||
Rectangle | rectangle, | ||
Rectangle::Side | side | ||
) |
Create RectangleClosestBorderTestCase.
x | Index of the first position to generate |
y | Index of the second position to generate |
rectangle | The 2D rectangle |
side | The expected result of the test |
Definition at line 169 of file rectangle-closest-border-test.cc.
|
override |
Destructor.
Definition at line 181 of file rectangle-closest-border-test.cc.
std::string RectangleClosestBorderTestCase::BuildNameString | ( | double | x, |
double | y, | ||
Rectangle | rectangle, | ||
Rectangle::Side | side | ||
) |
Builds the test name string based on provided parameter values.
x | Index of the first position to generate |
y | Index of the second position to generate |
rectangle | The 2D rectangle |
side | The expected result of the test |
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.
|
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.
|
private |
The rectangle to check the intersection with.
Definition at line 78 of file rectangle-closest-border-test.cc.
Referenced by DoRun().
|
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().
|
private |
X coordinate of the point to be tested.
Definition at line 76 of file rectangle-closest-border-test.cc.
Referenced by DoRun().
|
private |
Y coordinate of the point to be tested.
Definition at line 77 of file rectangle-closest-border-test.cc.
Referenced by DoRun().