KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_stacked_pin_conversion.cpp File Reference
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <sch_pin.h>
#include <lib_symbol.h>
#include <eeschema_test_utils.h>
#include <units_provider.h>
#include <base_units.h>

Go to the source code of this file.

Classes

struct  STACKED_PIN_CONVERSION_FIXTURE
 

Functions

void CheckDuplicatePins (LIB_SYMBOL *aSymbol, std::vector< wxString > &aMessages, UNITS_PROVIDER *aUnitsProvider)
 
 BOOST_AUTO_TEST_CASE (TestStackedPinExpansion)
 Test basic stacked pin number expansion functionality.
 
 BOOST_AUTO_TEST_CASE (TestStackedPinValidity)
 Test stacked pin validity checking.
 
 BOOST_AUTO_TEST_CASE (TestPinCreation)
 Test pin creation and positioning for conversion tests.
 
 BOOST_AUTO_TEST_CASE (TestStackedPinNetNaming)
 Test net name generation with stacked pins.
 
 BOOST_AUTO_TEST_CASE (TestConvertMultiplePinsToStacked)
 Test conversion from multiple co-located pins to stacked notation.
 
 BOOST_AUTO_TEST_CASE (TestRangeCollapsingConversion)
 Test range collapsing functionality in stacked pin conversion.
 
 BOOST_AUTO_TEST_CASE (TestRoundTripConversion)
 Test round-trip conversion: multiple pins -> stacked -> multiple pins.
 
 BOOST_AUTO_TEST_CASE (TestVisibilityHandling)
 Test visibility behavior during conversions.
 
 BOOST_AUTO_TEST_CASE (TestAlphanumericRangeCollapsing)
 Test alphanumeric range collapsing functionality.
 
 BOOST_AUTO_TEST_CASE (TestDuplicatePinDetectionWithStackedNotation)
 
 BOOST_AUTO_TEST_CASE (TestStackedPinCountEfficiency)
 Test that GetStackedPinCount returns the same count as GetStackedPinNumbers().size() but more efficiently.
 
 BOOST_AUTO_TEST_CASE (TestExplodePowerInputDemotesToPassive)
 Test that exploding a stacked power input pin demotes hidden pins to passive.
 
 BOOST_AUTO_TEST_CASE (TestExplodeNonPowerPinPreservesType)
 Test that exploding a stacked non-power pin preserves the original type on hidden pins.
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/13]

BOOST_AUTO_TEST_CASE ( TestAlphanumericRangeCollapsing )

Test alphanumeric range collapsing functionality.

Definition at line 638 of file test_stacked_pin_conversion.cpp.

References BOOST_CHECK_EQUAL(), and end.

◆ BOOST_AUTO_TEST_CASE() [2/13]

BOOST_AUTO_TEST_CASE ( TestConvertMultiplePinsToStacked )

◆ BOOST_AUTO_TEST_CASE() [3/13]

BOOST_AUTO_TEST_CASE ( TestDuplicatePinDetectionWithStackedNotation )

◆ BOOST_AUTO_TEST_CASE() [4/13]

BOOST_AUTO_TEST_CASE ( TestExplodeNonPowerPinPreservesType )

◆ BOOST_AUTO_TEST_CASE() [5/13]

BOOST_AUTO_TEST_CASE ( TestExplodePowerInputDemotesToPassive )

Test that exploding a stacked power input pin demotes hidden pins to passive.

Regression test for GitLab issue #23021.

Hidden power input pins act as global labels, so the explode operation must change hidden copies to PT_PASSIVE to avoid creating unintended power nets.

Definition at line 834 of file test_stacked_pin_conversion.cpp.

References BOOST_REQUIRE(), SCH_PIN::GetLength(), SCH_PIN::GetName(), SCH_PIN::GetOrientation(), SCH_PIN::GetPosition(), SCH_PIN::GetShape(), SCH_PIN::GetStackedPinNumbers(), SCH_PIN::GetType(), PIN_RIGHT, PT_PASSIVE, PT_POWER_IN, SCH_PIN::SetLength(), SCH_PIN::SetName(), SCH_PIN::SetNumber(), SCH_PIN::SetOrientation(), SCH_PIN::SetPosition(), SCH_PIN::SetShape(), SCH_PIN::SetType(), and SCH_PIN::SetVisible().

◆ BOOST_AUTO_TEST_CASE() [6/13]

BOOST_AUTO_TEST_CASE ( TestPinCreation )

Test pin creation and positioning for conversion tests.

Definition at line 134 of file test_stacked_pin_conversion.cpp.

References BOOST_CHECK_EQUAL(), SCH_PIN::GetPosition(), SCH_PIN::IsStacked(), PIN_RIGHT, SCH_PIN::SetNumber(), SCH_PIN::SetOrientation(), and SCH_PIN::SetPosition().

◆ BOOST_AUTO_TEST_CASE() [7/13]

BOOST_AUTO_TEST_CASE ( TestRangeCollapsingConversion )

Test range collapsing functionality in stacked pin conversion.

Definition at line 257 of file test_stacked_pin_conversion.cpp.

References BOOST_CHECK_EQUAL(), end, SCH_PIN::GetStackedPinNumbers(), result, and SCH_PIN::SetNumber().

◆ BOOST_AUTO_TEST_CASE() [8/13]

◆ BOOST_AUTO_TEST_CASE() [9/13]

BOOST_AUTO_TEST_CASE ( TestStackedPinCountEfficiency )

Test that GetStackedPinCount returns the same count as GetStackedPinNumbers().size() but more efficiently.

Definition at line 780 of file test_stacked_pin_conversion.cpp.

References BOOST_CHECK_EQUAL(), and pin.

◆ BOOST_AUTO_TEST_CASE() [10/13]

BOOST_AUTO_TEST_CASE ( TestStackedPinExpansion )

Test basic stacked pin number expansion functionality.

Definition at line 48 of file test_stacked_pin_conversion.cpp.

References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), and pin.

◆ BOOST_AUTO_TEST_CASE() [11/13]

BOOST_AUTO_TEST_CASE ( TestStackedPinNetNaming )

Test net name generation with stacked pins.

Definition at line 171 of file test_stacked_pin_conversion.cpp.

References BOOST_CHECK_EQUAL(), and pin.

◆ BOOST_AUTO_TEST_CASE() [12/13]

BOOST_AUTO_TEST_CASE ( TestStackedPinValidity )

Test stacked pin validity checking.

Definition at line 100 of file test_stacked_pin_conversion.cpp.

References BOOST_CHECK_EQUAL(), and pin.

◆ BOOST_AUTO_TEST_CASE() [13/13]

BOOST_AUTO_TEST_CASE ( TestVisibilityHandling )

Test visibility behavior during conversions.

Definition at line 594 of file test_stacked_pin_conversion.cpp.

References BOOST_CHECK_EQUAL(), and pin.

◆ CheckDuplicatePins()

void CheckDuplicatePins ( LIB_SYMBOL * aSymbol,
std::vector< wxString > & aMessages,
UNITS_PROVIDER * aUnitsProvider )
extern

Definition at line 38 of file symbol_checker.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and CheckLibSymbol().