|
KiCad PCB EDA Suite
|
#include <qa_utils/wx_utils/unit_test_utils.h>#include <boost/test/data/test_case.hpp>#include <geometry/arc_chord_params.h>#include <cmath>Go to the source code of this file.
Functions | |
| BOOST_AUTO_TEST_CASE (DegenerateCases) | |
| Test that degenerate cases (collinear points) return invalid. | |
| BOOST_AUTO_TEST_CASE (QuarterCircle) | |
| Test a simple 90-degree arc (quarter circle). | |
| BOOST_AUTO_TEST_CASE (Semicircle) | |
| Test a semicircle (180-degree arc). | |
| BOOST_AUTO_TEST_CASE (ShallowArc) | |
| Test a shallow arc (large radius, small arc angle). | |
| BOOST_AUTO_TEST_CASE (StartEndAngles) | |
| Test that start and end angles are correct. | |
| BOOST_AUTO_TEST_CASE (OffsetCenter) | |
| Test arc with center not at origin. | |
| BOOST_AUTO_TEST_CASE (ArcDirection) | |
| Test clockwise vs counter-clockwise arcs. | |
| BOOST_AUTO_TEST_CASE (ChordMidpoint) | |
| Test that GetChordMidpoint returns correct values. | |
| BOOST_AUTO_TEST_CASE (UnitVectorsNormalized) | |
| Test unit vectors are normalized. | |
| BOOST_AUTO_TEST_CASE (MajorArc) | |
| Test a major arc (greater than 180 degrees). | |
| BOOST_AUTO_TEST_CASE | ( | ArcDirection | ) |
Test clockwise vs counter-clockwise arcs.
Definition at line 223 of file test_arc_chord_params.cpp.
References BOOST_REQUIRE(), ARC_CHORD_PARAMS::Compute(), end, ARC_CHORD_PARAMS::GetArcAngle(), ARC_CHORD_PARAMS::GetCenterPoint(), ARC_CHORD_PARAMS::GetNormalUnitVec(), ARC_CHORD_PARAMS::GetRadius(), M_PI, radius, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | ChordMidpoint | ) |
Test that GetChordMidpoint returns correct values.
Definition at line 268 of file test_arc_chord_params.cpp.
References BOOST_REQUIRE(), ARC_CHORD_PARAMS::Compute(), end, ARC_CHORD_PARAMS::GetChordMidpoint(), VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | DegenerateCases | ) |
Test that degenerate cases (collinear points) return invalid.
Definition at line 33 of file test_arc_chord_params.cpp.
References BOOST_AUTO_TEST_CASE(), ARC_CHORD_PARAMS::Compute(), and ARC_CHORD_PARAMS::IsValid().
| BOOST_AUTO_TEST_CASE | ( | MajorArc | ) |
Test a major arc (greater than 180 degrees).
Definition at line 318 of file test_arc_chord_params.cpp.
References BOOST_REQUIRE(), ARC_CHORD_PARAMS::Compute(), end, ARC_CHORD_PARAMS::GetArcAngle(), ARC_CHORD_PARAMS::GetRadius(), ARC_CHORD_PARAMS::IsValid(), KiROUND(), M_PI, and radius.
| BOOST_AUTO_TEST_CASE | ( | OffsetCenter | ) |
Test arc with center not at origin.
Definition at line 193 of file test_arc_chord_params.cpp.
References BOOST_REQUIRE(), center, ARC_CHORD_PARAMS::Compute(), end, ARC_CHORD_PARAMS::GetCenterPoint(), ARC_CHORD_PARAMS::GetRadius(), ARC_CHORD_PARAMS::IsValid(), KiROUND(), and radius.
| BOOST_AUTO_TEST_CASE | ( | QuarterCircle | ) |
Test a simple 90-degree arc (quarter circle).
Definition at line 54 of file test_arc_chord_params.cpp.
References BOOST_REQUIRE(), center, ARC_CHORD_PARAMS::Compute(), end, ARC_CHORD_PARAMS::GetArcAngle(), ARC_CHORD_PARAMS::GetCenterPoint(), ARC_CHORD_PARAMS::GetChordLength(), ARC_CHORD_PARAMS::GetRadius(), ARC_CHORD_PARAMS::GetSagitta(), ARC_CHORD_PARAMS::IsValid(), KiROUND(), M_PI, and radius.
| BOOST_AUTO_TEST_CASE | ( | Semicircle | ) |
Test a semicircle (180-degree arc).
Definition at line 94 of file test_arc_chord_params.cpp.
References BOOST_REQUIRE(), center, ARC_CHORD_PARAMS::Compute(), end, ARC_CHORD_PARAMS::GetArcAngle(), ARC_CHORD_PARAMS::GetCenterOffset(), ARC_CHORD_PARAMS::GetCenterPoint(), ARC_CHORD_PARAMS::GetChordLength(), ARC_CHORD_PARAMS::GetRadius(), ARC_CHORD_PARAMS::GetSagitta(), ARC_CHORD_PARAMS::IsValid(), M_PI, and radius.
| BOOST_AUTO_TEST_CASE | ( | ShallowArc | ) |
Test a shallow arc (large radius, small arc angle).
Definition at line 131 of file test_arc_chord_params.cpp.
References BOOST_REQUIRE(), center, ARC_CHORD_PARAMS::Compute(), end, ARC_CHORD_PARAMS::GetArcAngle(), ARC_CHORD_PARAMS::GetCenterPoint(), ARC_CHORD_PARAMS::GetRadius(), ARC_CHORD_PARAMS::IsValid(), KiROUND(), M_PI, and radius.
| BOOST_AUTO_TEST_CASE | ( | StartEndAngles | ) |
Test that start and end angles are correct.
Definition at line 167 of file test_arc_chord_params.cpp.
References std::abs(), EDA_ANGLE::AsDegrees(), BOOST_REQUIRE(), ARC_CHORD_PARAMS::Compute(), end, ARC_CHORD_PARAMS::GetEndAngle(), ARC_CHORD_PARAMS::GetStartAngle(), and radius.
| BOOST_AUTO_TEST_CASE | ( | UnitVectorsNormalized | ) |
Test unit vectors are normalized.
Definition at line 289 of file test_arc_chord_params.cpp.
References BOOST_REQUIRE(), ARC_CHORD_PARAMS::Compute(), end, ARC_CHORD_PARAMS::GetChordUnitVec(), ARC_CHORD_PARAMS::GetNormalUnitVec(), VECTOR2< T >::x, and VECTOR2< T >::y.