|
KiCad PCB EDA Suite
|
#include <boost/test/unit_test.hpp>#include <api/api_utils.h>#include <api/common/types/base_types.pb.h>#include <base_units.h>#include <sch_line.h>Go to the source code of this file.
Functions | |
| BOOST_AUTO_TEST_CASE (UnpackVector2RoundTripsThroughSchIuScale) | |
| Regression tests for the IU-scale handling in API_HANDLER_EDITOR::handleHitTest. | |
| BOOST_AUTO_TEST_CASE (UnpackVector2WithWrongScaleYieldsWrongPosition) | |
| BOOST_AUTO_TEST_CASE (HitTestHitsWhenPositionUnpackedWithSchIuScale) | |
| BOOST_AUTO_TEST_CASE (ToleranceScalesFromNanometersToSchIu) | |
| BOOST_AUTO_TEST_CASE | ( | HitTestHitsWhenPositionUnpackedWithSchIuScale | ) |
Definition at line 70 of file test_sch_api_hittest.cpp.
References SCH_LINE::HitTest(), kiapi::common::PackVector2(), pcbIUScale, schIUScale, SCH_LINE::SetEndPoint(), SCH_LINE::SetStartPoint(), and kiapi::common::UnpackVector2().
| BOOST_AUTO_TEST_CASE | ( | ToleranceScalesFromNanometersToSchIu | ) |
Definition at line 89 of file test_sch_api_hittest.cpp.
References BOOST_CHECK_EQUAL(), SCH_LINE::GetPenWidth(), SCH_LINE::HitTest(), schIUScale, SCH_LINE::SetEndPoint(), and SCH_LINE::SetStartPoint().
| BOOST_AUTO_TEST_CASE | ( | UnpackVector2RoundTripsThroughSchIuScale | ) |
Regression tests for the IU-scale handling in API_HANDLER_EDITOR::handleHitTest.
Wire coordinates are always in nanometers. Prior to the fix, the schematic handler inherited the base class default of pcbIUScale, so positions sent in nanometers were decoded as pcb-IU (1 nm/IU) and then handed to schematic items whose native IU is 100 nm. Every position was therefore 100x too large, and every HitTest missed.
Definition at line 39 of file test_sch_api_hittest.cpp.
References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), kiapi::common::PackVector2(), schIUScale, kiapi::common::UnpackVector2(), VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | UnpackVector2WithWrongScaleYieldsWrongPosition | ) |
Definition at line 55 of file test_sch_api_hittest.cpp.
References BOOST_CHECK_EQUAL(), kiapi::common::PackVector2(), pcbIUScale, schIUScale, kiapi::common::UnpackVector2(), VECTOR2< T >::x, and VECTOR2< T >::y.