KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_pin_stacked_layout.cpp File Reference

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_SYMBOLcreateTestResistorSymbol ()
 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_SYMBOLcreateNumberOnlySymbol ()
 
static std::vector< int > collectNumberGapsPerRotation (SCH_PIN *aPin)
 
 BOOST_AUTO_TEST_CASE (PinNumberGapConstantAcrossRotations)
 
 BOOST_AUTO_TEST_CASE (PinNumberOnlyGapConstantAcrossRotations)
 
static std::unique_ptr< LIB_SYMBOLcreateMirrorTestSymbol ()
 
static PIN_LAYOUT_CACHE::TEXT_INFO numberInfoWithTransform (SCH_PIN *aPin, const TRANSFORM &aTransform)
 
 BOOST_AUTO_TEST_CASE (StackedTextSideFlippedTransforms)
 
 BOOST_AUTO_TEST_CASE (StackedBlockFollowsMirror)
 

Detailed Description

Test pin number layout for stacked multi-line numbers across all rotations.

Definition in file test_pin_stacked_layout.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/7]

BOOST_AUTO_TEST_CASE ( PinNumberGapConstantAcrossRotations )

◆ BOOST_AUTO_TEST_CASE() [2/7]

BOOST_AUTO_TEST_CASE ( PinNumberOnlyGapConstantAcrossRotations )

◆ BOOST_AUTO_TEST_CASE() [3/7]

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() [4/7]

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() [5/7]

◆ BOOST_AUTO_TEST_CASE() [6/7]

◆ BOOST_AUTO_TEST_CASE() [7/7]

BOOST_AUTO_TEST_CASE ( StackedTextSideFlippedTransforms )

◆ collectNumberGapsPerRotation()

◆ createMirrorTestSymbol()

static std::unique_ptr< LIB_SYMBOL > createMirrorTestSymbol ( )
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().

◆ createNumberOnlySymbol()

static std::unique_ptr< LIB_SYMBOL > createNumberOnlySymbol ( )
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().

◆ createTestResistorSymbol()

static std::unique_ptr< LIB_SYMBOL > createTestResistorSymbol ( )
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().

◆ getPinLineEnd()

static VECTOR2I getPinLineEnd ( const SCH_PIN * pin,
const TRANSFORM & transform )
static

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().

◆ nearEdgeClearance()

◆ numberInfoWithTransform()

static PIN_LAYOUT_CACHE::TEXT_INFO numberInfoWithTransform ( SCH_PIN * aPin,
const TRANSFORM & aTransform )
static