|
KiCad PCB EDA Suite
|
Test pin number layout for stacked multi-line numbers across all rotations. More...
#include <qa_utils/wx_utils/unit_test_utils.h>#include <sch_pin.h>#include <lib_symbol.h>#include <pin_layout_cache.h>#include <transform.h>#include <sch_io/sch_io_mgr.h>#include <wx/log.h>#include <boost/test/unit_test.hpp>Go to the source code of this file.
Functions | |
| static std::unique_ptr< LIB_SYMBOL > | createTestResistorSymbol () |
| Create a test symbol with stacked pin numbers for rotation testing. | |
| static VECTOR2I | getPinLineEnd (const SCH_PIN *pin, const TRANSFORM &transform) |
| Get pin geometry (line segment from connection point to pin end) | |
| BOOST_AUTO_TEST_CASE (PinNumbersNoOverlapAllRotations) | |
| Test that pin numbers don't overlap with pin geometry across all rotations. | |
| BOOST_AUTO_TEST_CASE (PinTextConsistentSidePlacement) | |
| Test that multiline and non-multiline pin numbers/names are positioned consistently with the name above (or left) and the number below (or right) for all rotations. | |
| static int | nearEdgeClearance (const SCH_PIN *aPin, const TRANSFORM &aTransform, const BOX2I &aBox) |
| BOOST_AUTO_TEST_CASE (PinTextSameBottomCoordinate) | |
| static std::unique_ptr< LIB_SYMBOL > | createNumberOnlySymbol () |
| static std::vector< int > | collectNumberGapsPerRotation (SCH_PIN *aPin) |
| BOOST_AUTO_TEST_CASE (PinNumberGapConstantAcrossRotations) | |
| BOOST_AUTO_TEST_CASE (PinNumberOnlyGapConstantAcrossRotations) | |
| static std::unique_ptr< LIB_SYMBOL > | createMirrorTestSymbol () |
| static PIN_LAYOUT_CACHE::TEXT_INFO | numberInfoWithTransform (SCH_PIN *aPin, const TRANSFORM &aTransform) |
| BOOST_AUTO_TEST_CASE (StackedTextSideFlippedTransforms) | |
| BOOST_AUTO_TEST_CASE (StackedBlockFollowsMirror) | |
Test pin number layout for stacked multi-line numbers across all rotations.
Definition in file test_pin_stacked_layout.cpp.
| BOOST_AUTO_TEST_CASE | ( | PinNumberGapConstantAcrossRotations | ) |
Definition at line 458 of file test_pin_stacked_layout.cpp.
References BOOST_REQUIRE(), collectNumberGapsPerRotation(), createTestResistorSymbol(), pin, and SCH_PIN_T.
| BOOST_AUTO_TEST_CASE | ( | PinNumberOnlyGapConstantAcrossRotations | ) |
Definition at line 491 of file test_pin_stacked_layout.cpp.
References BOOST_REQUIRE(), collectNumberGapsPerRotation(), createNumberOnlySymbol(), pin, and SCH_PIN_T.
| BOOST_AUTO_TEST_CASE | ( | PinNumbersNoOverlapAllRotations | ) |
Test that pin numbers don't overlap with pin geometry across all rotations.
Definition at line 110 of file test_pin_stacked_layout.cpp.
References BOOST_REQUIRE(), createTestResistorSymbol(), DefaultTransform, getPinLineEnd(), PIN_LAYOUT_CACHE::GetPinNumberBBox(), BOX2< Vec >::Inflate(), BOX2< Vec >::Intersects(), pin, and SCH_PIN_T.
| BOOST_AUTO_TEST_CASE | ( | PinTextConsistentSidePlacement | ) |
Test that multiline and non-multiline pin numbers/names are positioned consistently with the name above (or left) and the number below (or right) for all rotations.
Definition at line 186 of file test_pin_stacked_layout.cpp.
References BOOST_REQUIRE(), createTestResistorSymbol(), DefaultTransform, PIN_LAYOUT_CACHE::GetPinNameInfo(), PIN_LAYOUT_CACHE::GetPinNumberInfo(), info, PIN_LAYOUT_CACHE::TEXT_INFO::m_Text, PIN_LAYOUT_CACHE::TEXT_INFO::m_TextPosition, pin, PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_UP, and SCH_PIN_T.
| BOOST_AUTO_TEST_CASE | ( | PinTextSameBottomCoordinate | ) |
Definition at line 318 of file test_pin_stacked_layout.cpp.
References std::abs(), BOOST_REQUIRE(), createTestResistorSymbol(), DefaultTransform, PIN_LAYOUT_CACHE::GetPinNameBBox(), PIN_LAYOUT_CACHE::GetPinNumberBBox(), nearEdgeClearance(), pin, and SCH_PIN_T.
| BOOST_AUTO_TEST_CASE | ( | StackedBlockFollowsMirror | ) |
Definition at line 639 of file test_pin_stacked_layout.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), createMirrorTestSymbol(), SCH_PIN::GetPosition(), PIN_LAYOUT_CACHE::TEXT_INFO::m_Text, PIN_LAYOUT_CACHE::TEXT_INFO::m_TextPosition, numberInfoWithTransform(), pin, SCH_PIN_T, SCH_PIN::SetFlipStackedTextSide(), VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | StackedTextSideFlippedTransforms | ) |
Definition at line 580 of file test_pin_stacked_layout.cpp.
References expected, pin, PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_UP, SCH_PIN::SetOrientation(), and SCH_PIN::StackedTextSideFlipped().
|
static |
Definition at line 418 of file test_pin_stacked_layout.cpp.
References std::abs(), DefaultTransform, SCH_PIN::GetNumber(), PIN_LAYOUT_CACHE::GetPinNumberInfo(), SCH_PIN::GetPosition(), PIN_LEFT, PIN_RIGHT, SCH_PIN::PinDrawOrient(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 525 of file test_pin_stacked_layout.cpp.
References PIN_LEFT, PIN_RIGHT, PIN_UP, PT_PASSIVE, and schIUScale.
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 387 of file test_pin_stacked_layout.cpp.
References pin1, PIN_LEFT, PIN_RIGHT, PT_PASSIVE, and schIUScale.
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Create a test symbol with stacked pin numbers for rotation testing.
Definition at line 41 of file test_pin_stacked_layout.cpp.
References createTestResistorSymbol(), pin1, PIN_DOWN, PIN_UP, PT_PASSIVE, and schIUScale.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and createTestResistorSymbol().
Get pin geometry (line segment from connection point to pin end)
Definition at line 78 of file test_pin_stacked_layout.cpp.
References end, INHERIT, pin, PIN_DOWN, PIN_LEFT, PIN_RIGHT, and PIN_UP.
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 305 of file test_pin_stacked_layout.cpp.
References std::abs(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), SCH_PIN::GetPosition(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), PIN_LEFT, PIN_RIGHT, SCH_PIN::PinDrawOrient(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 564 of file test_pin_stacked_layout.cpp.
References DefaultTransform, SCH_PIN::GetNumber(), PIN_LAYOUT_CACHE::GetPinNumberInfo(), and info.
Referenced by BOOST_AUTO_TEST_CASE().