KiCad PCB EDA Suite
|
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <qa_utils/geometry/geometry.h>
#include <math/box2.h>
Go to the source code of this file.
Functions | |
BOOST_AUTO_TEST_CASE (DefaultConstructor) | |
Test suite for KiCad math code. | |
BOOST_AUTO_TEST_CASE (BasicInt) | |
BOOST_AUTO_TEST_CASE (Constexpr) | |
BOOST_AUTO_TEST_CASE (BasicDouble) | |
BOOST_AUTO_TEST_CASE (ByCorners) | |
BOOST_AUTO_TEST_CASE (ByCentre) | |
BOOST_CHECK (box.ClosestPointTo(VECTOR2D(0, 0))==VECTOR2D(1, 2)) | |
BOOST_CHECK (box.ClosestPointTo(VECTOR2D(2, 0))==VECTOR2D(2, 2)) | |
BOOST_CHECK (box.ClosestPointTo(VECTOR2D(6, 0))==VECTOR2D(4, 2)) | |
BOOST_CHECK (box.ClosestPointTo(VECTOR2D(6, 5))==VECTOR2D(4, 5)) | |
BOOST_CHECK (box.ClosestPointTo(VECTOR2D(6, 7))==VECTOR2D(4, 6)) | |
BOOST_CHECK (box.ClosestPointTo(VECTOR2D(3, 7))==VECTOR2D(3, 6)) | |
BOOST_CHECK (box.ClosestPointTo(VECTOR2D(0, 7))==VECTOR2D(1, 6)) | |
BOOST_CHECK (box.ClosestPointTo(VECTOR2D(0, 3))==VECTOR2D(1, 3)) | |
BOOST_CHECK (box.ClosestPointTo(VECTOR2D(2, 4))==VECTOR2D(2, 4)) | |
BOOST_CHECK (box.FarthestPointTo(VECTOR2D(2, 3))==VECTOR2D(4, 6)) | |
BOOST_CHECK (box.FarthestPointTo(VECTOR2D(3, 3))==VECTOR2D(1, 6)) | |
BOOST_CHECK (box.FarthestPointTo(VECTOR2D(3, 5))==VECTOR2D(1, 2)) | |
BOOST_CHECK (box.FarthestPointTo(VECTOR2D(2, 5))==VECTOR2D(4, 2)) | |
BOOST_CHECK (box.IntersectsCircle(VECTOR2D(4, 6), 5)==true) | |
BOOST_CHECK (box.IntersectsCircle(VECTOR2D(4, 6), 6)==true) | |
BOOST_CHECK (box.IntersectsCircle(VECTOR2D(4, 6), 2)==true) | |
BOOST_CHECK (box.IntersectsCircle(VECTOR2D(14, 6), 5)==false) | |
BOOST_CHECK (box.IntersectsCircleEdge(VECTOR2D(4, 6), 5, 1)==true) | |
BOOST_CHECK (box.IntersectsCircleEdge(VECTOR2D(4, 6), 6, 1)==false) | |
BOOST_CHECK (box.IntersectsCircleEdge(VECTOR2D(4, 6), 2, 1)==true) | |
BOOST_CHECK (box.IntersectsCircleEdge(VECTOR2D(14, 6), 5, 1)==false) | |
BOOST_AUTO_TEST_CASE | ( | BasicDouble | ) |
Definition at line 86 of file test_box2.cpp.
References BOX2< Vec >::GetPosition(), BOX2< Vec >::GetSize(), and BOX2< Vec >::Inflate().
BOOST_AUTO_TEST_CASE | ( | BasicInt | ) |
Definition at line 47 of file test_box2.cpp.
References BOOST_CHECK(), BOX2< Vec >::GetInflated(), BOX2< Vec >::GetPosition(), BOX2< Vec >::GetSize(), and BOX2< Vec >::Inflate().
BOOST_AUTO_TEST_CASE | ( | ByCentre | ) |
Definition at line 107 of file test_box2.cpp.
References BOOST_CHECK(), and BOX2< VECTOR2I >::ByCenter().
BOOST_AUTO_TEST_CASE | ( | ByCorners | ) |
Definition at line 99 of file test_box2.cpp.
References BOOST_CHECK(), and BOX2< VECTOR2I >::ByCorners().
BOOST_AUTO_TEST_CASE | ( | Constexpr | ) |
Definition at line 68 of file test_box2.cpp.
References BOX2< Vec >::GetInflated(), BOX2< Vec >::GetPosition(), BOX2< Vec >::GetSize(), BOX2< Vec >::GetWithOffset(), and BOX2< Vec >::SquaredDiagonal().
BOOST_AUTO_TEST_CASE | ( | DefaultConstructor | ) |
Test suite for KiCad math code.
Declare the test suite
Definition at line 40 of file test_box2.cpp.
References BOX2< Vec >::GetPosition(), and BOX2< Vec >::GetSize().
BOOST_CHECK | ( | box. | ClosestPointToVECTOR2D(0, 0) = =VECTOR2D(1, 2) | ) |
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_DATA_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), KI_TEST::CheckFootprint(), TEST_NETLIST_EXPORTER_SPICE_FIXTURE::CompareNetlists(), TEST_SIM_LIBRARY_SPICE_FIXTURE::CompareToUsualDiodeModel(), TestConcaveSquareFillet(), testGroupEqual(), testGroupsEqual(), TestSquareFillet(), and TEST_SIM_LIBRARY_SPICE_FIXTURE::TestTransistor().
BOOST_CHECK | ( | box. | ClosestPointToVECTOR2D(0, 3) = =VECTOR2D(1, 3) | ) |
BOOST_CHECK | ( | box. | ClosestPointToVECTOR2D(0, 7) = =VECTOR2D(1, 6) | ) |
BOOST_CHECK | ( | box. | ClosestPointToVECTOR2D(2, 0) = =VECTOR2D(2, 2) | ) |
BOOST_CHECK | ( | box. | ClosestPointToVECTOR2D(2, 4) = =VECTOR2D(2, 4) | ) |
BOOST_CHECK | ( | box. | ClosestPointToVECTOR2D(3, 7) = =VECTOR2D(3, 6) | ) |
BOOST_CHECK | ( | box. | ClosestPointToVECTOR2D(6, 0) = =VECTOR2D(4, 2) | ) |
BOOST_CHECK | ( | box. | ClosestPointToVECTOR2D(6, 5) = =VECTOR2D(4, 5) | ) |
BOOST_CHECK | ( | box. | ClosestPointToVECTOR2D(6, 7) = =VECTOR2D(4, 6) | ) |
BOOST_CHECK | ( | box. | FarthestPointToVECTOR2D(2, 3) = =VECTOR2D(4, 6) | ) |
BOOST_CHECK | ( | box. | FarthestPointToVECTOR2D(2, 5) = =VECTOR2D(4, 2) | ) |
BOOST_CHECK | ( | box. | FarthestPointToVECTOR2D(3, 3) = =VECTOR2D(1, 6) | ) |
BOOST_CHECK | ( | box. | FarthestPointToVECTOR2D(3, 5) = =VECTOR2D(1, 2) | ) |
BOOST_CHECK | ( | box. | IntersectsCircleVECTOR2D(14, 6), 5 = =false | ) |
BOOST_CHECK | ( | box. | IntersectsCircleVECTOR2D(4, 6), 2 = =true | ) |
BOOST_CHECK | ( | box. | IntersectsCircleVECTOR2D(4, 6), 5 = =true | ) |
BOOST_CHECK | ( | box. | IntersectsCircleVECTOR2D(4, 6), 6 = =true | ) |
BOOST_CHECK | ( | box. | IntersectsCircleEdgeVECTOR2D(14, 6), 5, 1 = =false | ) |
BOOST_CHECK | ( | box. | IntersectsCircleEdgeVECTOR2D(4, 6), 2, 1 = =true | ) |
BOOST_CHECK | ( | box. | IntersectsCircleEdgeVECTOR2D(4, 6), 5, 1 = =true | ) |
BOOST_CHECK | ( | box. | IntersectsCircleEdgeVECTOR2D(4, 6), 6, 1 = =false | ) |