| 
    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)   | |
| static bool | boxIntersectsLine (const BOX2I &box, const VECTOR2I &lineStart, const VECTOR2I &lineEnd) | 
| Check if a box intersects with a line segment.   | |
| 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.   | |
| BOOST_AUTO_TEST_CASE (PinTextSameBottomCoordinate) | |
| Test that multiline and non-multiline pin numbers/names have the same bottom coordinate (distance from pin along the axis connecting pin and text)   | |
Test pin number layout for stacked multi-line numbers across all rotations.
Definition in file test_pin_stacked_layout.cpp.
| BOOST_AUTO_TEST_CASE | ( | PinNumbersNoOverlapAllRotations | ) | 
Test that pin numbers don't overlap with pin geometry across all rotations.
Definition at line 148 of file test_pin_stacked_layout.cpp.
References ANGLE_VERTICAL, BOOST_REQUIRE(), boxIntersectsLine(), createTestResistorSymbol(), DefaultTransform, BOX2< Vec >::GetHeight(), BOX2< Vec >::GetLeft(), getPinLineEnd(), PIN_LAYOUT_CACHE::GetPinNumberInfo(), BOX2< Vec >::GetTop(), BOX2< Vec >::GetWidth(), PIN_LAYOUT_CACHE::TEXT_INFO::m_Angle, PIN_LAYOUT_CACHE::TEXT_INFO::m_Text, PIN_LAYOUT_CACHE::TEXT_INFO::m_TextPosition, PIN_LAYOUT_CACHE::TEXT_INFO::m_TextSize, pin, SCH_PIN_T, BOX2< Vec >::SetOrigin(), BOX2< Vec >::SetSize(), wxStringSplit(), VECTOR2< T >::x, and VECTOR2< T >::y.
| 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 277 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 | ) | 
Test that multiline and non-multiline pin numbers/names have the same bottom coordinate (distance from pin along the axis connecting pin and text)
Definition at line 399 of file test_pin_stacked_layout.cpp.
References BOOST_REQUIRE(), createTestResistorSymbol(), DefaultTransform, PIN_LAYOUT_CACHE::GetPinNameInfo(), PIN_LAYOUT_CACHE::GetPinNumberInfo(), PIN_LAYOUT_CACHE::TEXT_INFO::m_Text, PIN_LAYOUT_CACHE::TEXT_INFO::m_TextPosition, PIN_LAYOUT_CACHE::TEXT_INFO::m_TextSize, pin, PIN_DOWN, PIN_UP, SCH_PIN_T, and wxStringSplit().
      
  | 
  static | 
Check if a box intersects with a line segment.
Definition at line 114 of file test_pin_stacked_layout.cpp.
References BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), BOX2< Vec >::Intersects(), BOX2< Vec >::SetEnd(), BOX2< Vec >::SetOrigin(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BOOST_AUTO_TEST_CASE().
      
  | 
  static | 
Create a test symbol with stacked pin numbers for rotation testing.
Definition at line 45 of file test_pin_stacked_layout.cpp.
References createTestResistorSymbol(), PIN_DOWN, PIN_UP, PT_PASSIVE, and schIUScale.
Referenced by 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 82 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().