TestCase to check the rectangle line intersection. More...
Public Member Functions | |
RectangleClosestBorderTestCase (double x, double y, Rectangle rectangle, Rectangle::Side side) | |
Create RectangleClosestBorderTestCase. | |
~RectangleClosestBorderTestCase () override | |
Destructor. | |
std::string | BuildNameString (double x, double y, Rectangle rectangle, Rectangle::Side side) |
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 | |
void | DoRun () override |
Setup the simulation according to the configuration set by the class constructor, run it, and verify the result. | |
Private Attributes | |
Rectangle | m_rectangle |
The rectangle to check the intersection with. | |
Rectangle::Side | m_side {ns3::Rectangle::TOPSIDE} |
Flag to indicate the intersection. | |
double | m_x {0.0} |
X coordinate of the point to be tested. | |
double | m_y {0.0} |
Y coordinate of the point to be tested. | |
Additional Inherited Members | |
Public Types inherited from ns3::TestCase | |
enum class | Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
Static Public Attributes inherited from ns3::TestCase | |
static constexpr auto | QUICK = Duration::QUICK |
Deprecated test duration simple enums. | |
static constexpr auto | EXTENSIVE = Duration::EXTENSIVE |
static constexpr auto | TAKES_FOREVER = Duration::TAKES_FOREVER |
Protected Member Functions inherited from ns3::TestCase | |
TestCase (std::string name) | |
Constructor. | |
void | AddTestCase (TestCase *testCase, Duration duration=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 rectangle line intersection.
Definition at line 32 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 158 of file rectangle-closest-border-test.cc.
|
override |
Destructor.
Definition at line 170 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 175 of file rectangle-closest-border-test.cc.
References 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 189 of file rectangle-closest-border-test.cc.
References ns3::Simulator::Destroy(), 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 67 of file rectangle-closest-border-test.cc.
Referenced by DoRun().
|
private |
Flag to indicate the intersection.
True, for intersection, false otherwise.
Definition at line 73 of file rectangle-closest-border-test.cc.
Referenced by DoRun().
|
private |
X coordinate of the point to be tested.
Definition at line 65 of file rectangle-closest-border-test.cc.
Referenced by DoRun().
|
private |
Y coordinate of the point to be tested.
Definition at line 66 of file rectangle-closest-border-test.cc.
Referenced by DoRun().