|
KiCad PCB EDA Suite
|
#include <qa_utils/wx_utils/unit_test_utils.h>#include <qa_utils/wx_utils/wx_assert.h>#include <lib_symbol.h>#include <pin_type.h>#include <sch_pin.h>#include <sch_symbol.h>Go to the source code of this file.
Classes | |
| class | TEST_SCH_PIN_FIXTURE |
Functions | |
| BOOST_AUTO_TEST_CASE (DefaultProperties) | |
| Declare the test suite. | |
| BOOST_AUTO_TEST_CASE (Assign) | |
| Check the assignment operator. | |
| BOOST_AUTO_TEST_CASE (Copy) | |
| Check the copy ctor. | |
| BOOST_AUTO_TEST_CASE (PinDangling) | |
| Check the pin dangling flag. | |
| BOOST_AUTO_TEST_CASE (PinNumbering) | |
| Check the pin labelling. | |
| BOOST_AUTO_TEST_CASE (PinNumberingPower) | |
| Check the pin labelling when it's a power pin. | |
| BOOST_AUTO_TEST_CASE (AlternatePinRenameUpdates) | |
| BOOST_AUTO_TEST_CASE (AlternatePinTypeReturnsCorrectType) | |
| Test for issue #22286 - GetType() should return the alternate's type when alternate is selected. | |
| BOOST_AUTO_TEST_CASE (AlternatePinTypePersistsThroughSymbolUpdate) | |
| Test for issue #22286 - simulate schematic loading scenario When a schematic is loaded, the pin's alternate is set BEFORE SetLibSymbol is called. | |
| BOOST_AUTO_TEST_CASE (ParserCreatedPinWithAlternate) | |
| Test for issue #22286 - simulate parser-created pins with alternates The parser creates pins with m_alt set but m_libPin=nullptr. | |
| BOOST_AUTO_TEST_CASE (LibraryPinAlternatesPreservedThroughCopy) | |
| Test for issue #22286 - detailed trace of SetLibSymbol flow Verifies that library pin alternates are preserved through the copy and that SetAlt succeeds in UpdatePins(). | |
| BOOST_AUTO_TEST_CASE (GetTypeBeforeLibPinSet) | |
| Test for issue #22286 - verify behavior when GetType() is called before m_libPin is set. | |
| BOOST_AUTO_TEST_CASE (ChangeSymbolFewerPinsNoCrash) | |
| Test for issue #22566 - changing to a symbol with fewer pins should not crash. | |
| BOOST_AUTO_TEST_CASE (HasConnectivityChangesForPowerPinVisibility) | |
| Test for issue #21159 - HasConnectivityChanges should detect visibility changes for power input pins because visibility affects IsGlobalPower() which changes connectivity semantics. | |
| BOOST_AUTO_TEST_CASE (HasConnectivityChangesForPinTypeChange) | |
| Test for issue #21159 - HasConnectivityChanges should detect pin type changes when changing to/from PT_POWER_IN. | |
| BOOST_AUTO_TEST_CASE | ( | AlternatePinRenameUpdates | ) |
Definition at line 192 of file test_sch_pin.cpp.
References BOOST_CHECK_EQUAL(), SCH_PIN::GetAlt(), SCH_PIN::GetAlternates(), INVERTED, SCH_PIN::ALT::m_Name, SCH_PIN::ALT::m_Shape, SCH_PIN::ALT::m_Type, and PT_INPUT.
| BOOST_AUTO_TEST_CASE | ( | AlternatePinTypePersistsThroughSymbolUpdate | ) |
Test for issue #22286 - simulate schematic loading scenario When a schematic is loaded, the pin's alternate is set BEFORE SetLibSymbol is called.
The alternate must persist through UpdatePins().
Definition at line 257 of file test_sch_pin.cpp.
References BOOST_CHECK_EQUAL(), LINE, SCH_PIN::ALT::m_Name, SCH_PIN::ALT::m_Shape, SCH_PIN::ALT::m_Type, PT_NC, and PT_POWER_IN.
| BOOST_AUTO_TEST_CASE | ( | AlternatePinTypeReturnsCorrectType | ) |
Test for issue #22286 - GetType() should return the alternate's type when alternate is selected.
Definition at line 221 of file test_sch_pin.cpp.
References BOOST_CHECK_EQUAL(), LINE, SCH_PIN::ALT::m_Name, SCH_PIN::ALT::m_Shape, SCH_PIN::ALT::m_Type, PT_NC, and PT_POWER_IN.
| BOOST_AUTO_TEST_CASE | ( | Assign | ) |
Check the assignment operator.
Definition at line 101 of file test_sch_pin.cpp.
References BOOST_CHECK_EQUAL(), SCH_PIN::GetNumber(), and SCH_ITEM::GetParentSymbol().
| BOOST_AUTO_TEST_CASE | ( | ChangeSymbolFewerPinsNoCrash | ) |
Test for issue #22566 - changing to a symbol with fewer pins should not crash.
Definition at line 549 of file test_sch_pin.cpp.
References LIB_SYMBOL::AddDrawItem(), BOOST_CHECK_EQUAL(), LIB_SYMBOL::Flatten(), LIB_SYMBOL::GetGraphicalPins(), LIB_SYMBOL::GetLibId(), SCH_SYMBOL::GetLibSymbolRef(), SCH_PIN::GetNumber(), SCH_SYMBOL::GetPin(), SCH_SYMBOL::GetPins(), path, PT_INPUT, PT_OUTPUT, SCH_SYMBOL::SetLibSymbol(), SCH_PIN::SetName(), SCH_PIN::SetNumber(), SCH_PIN::SetPosition(), SCH_SYMBOL::SetRef(), SCH_PIN::SetType(), and SCH_SYMBOL::UpdatePins().
| BOOST_AUTO_TEST_CASE | ( | Copy | ) |
Check the copy ctor.
Definition at line 112 of file test_sch_pin.cpp.
References BOOST_CHECK_EQUAL(), copied, SCH_PIN::GetAlt(), INVERTED, SCH_PIN::ALT::m_Name, SCH_PIN::ALT::m_Shape, SCH_PIN::ALT::m_Type, and PT_OUTPUT.
| BOOST_AUTO_TEST_CASE | ( | DefaultProperties | ) |
Declare the test suite.
Check basic properties of an un-modified SCH_PIN object
Definition at line 81 of file test_sch_pin.cpp.
References BOOST_AUTO_TEST_CASE(), and BOOST_CHECK_EQUAL().
| BOOST_AUTO_TEST_CASE | ( | GetTypeBeforeLibPinSet | ) |
Test for issue #22286 - verify behavior when GetType() is called before m_libPin is set.
This simulates what happens if GetType() is called during loading before UpdateLocalLibSymbolLinks() runs.
Definition at line 484 of file test_sch_pin.cpp.
References LIB_SYMBOL::AddDrawItem(), BOOST_CHECK_EQUAL(), SCH_PIN::GetAlt(), SCH_PIN::GetAlternates(), LIB_SYMBOL::GetLibId(), SCH_PIN::GetLibPin(), SCH_SYMBOL::GetPins(), SCH_SYMBOL::GetRawPins(), SCH_PIN::GetShownName(), SCH_PIN::GetType(), LINE, SCH_PIN::ALT::m_Name, SCH_PIN::ALT::m_Shape, SCH_PIN::ALT::m_Type, path, PT_NC, PT_POWER_IN, PT_UNSPECIFIED, SCH_SYMBOL::SetLibId(), SCH_SYMBOL::SetLibSymbol(), SCH_PIN::SetName(), SCH_PIN::SetNumber(), SCH_PIN::SetPosition(), and SCH_PIN::SetType().
| BOOST_AUTO_TEST_CASE | ( | HasConnectivityChangesForPinTypeChange | ) |
Test for issue #21159 - HasConnectivityChanges should detect pin type changes when changing to/from PT_POWER_IN.
Definition at line 703 of file test_sch_pin.cpp.
References LIB_SYMBOL::AddDrawItem(), LIB_SYMBOL::GetLibId(), SCH_SYMBOL::GetPins(), SCH_PIN::HasConnectivityChanges(), path, PT_INPUT, PT_POWER_IN, SCH_PIN::SetName(), SCH_PIN::SetNumber(), SCH_PIN::SetPosition(), SCH_SYMBOL::SetRef(), SCH_PIN::SetType(), and SCH_SYMBOL::UpdatePins().
| BOOST_AUTO_TEST_CASE | ( | HasConnectivityChangesForPowerPinVisibility | ) |
Test for issue #21159 - HasConnectivityChanges should detect visibility changes for power input pins because visibility affects IsGlobalPower() which changes connectivity semantics.
Definition at line 621 of file test_sch_pin.cpp.
References LIB_SYMBOL::AddDrawItem(), LIB_SYMBOL::GetLibId(), SCH_SYMBOL::GetPins(), SCH_PIN::GetType(), SCH_PIN::HasConnectivityChanges(), SCH_PIN::IsGlobalPower(), SCH_PIN::IsVisible(), path, PT_INPUT, PT_POWER_IN, SCH_PIN::SetName(), SCH_PIN::SetNumber(), SCH_PIN::SetPosition(), SCH_SYMBOL::SetRef(), SCH_PIN::SetType(), SCH_PIN::SetVisible(), and SCH_SYMBOL::UpdatePins().
| BOOST_AUTO_TEST_CASE | ( | LibraryPinAlternatesPreservedThroughCopy | ) |
Test for issue #22286 - detailed trace of SetLibSymbol flow Verifies that library pin alternates are preserved through the copy and that SetAlt succeeds in UpdatePins().
Definition at line 374 of file test_sch_pin.cpp.
References LIB_SYMBOL::AddDrawItem(), BOOST_CHECK_EQUAL(), SCH_PIN::GetAlt(), SCH_PIN::GetAlternates(), LIB_SYMBOL::GetGraphicalPins(), LIB_SYMBOL::GetLibId(), SCH_PIN::GetLibPin(), SCH_SYMBOL::GetPins(), SCH_SYMBOL::GetRawPins(), SCH_PIN::GetType(), LINE, SCH_PIN::ALT::m_Name, SCH_PIN::ALT::m_Shape, SCH_PIN::ALT::m_Type, path, PT_NC, PT_POWER_IN, SCH_SYMBOL::SetLibSymbol(), SCH_PIN::SetName(), SCH_PIN::SetNumber(), SCH_PIN::SetPosition(), SCH_SYMBOL::SetRef(), and SCH_PIN::SetType().
| BOOST_AUTO_TEST_CASE | ( | ParserCreatedPinWithAlternate | ) |
Test for issue #22286 - simulate parser-created pins with alternates The parser creates pins with m_alt set but m_libPin=nullptr.
Verify that after UpdatePins() the alternate type is correctly returned.
Definition at line 296 of file test_sch_pin.cpp.
References LIB_SYMBOL::AddDrawItem(), BOOST_CHECK_EQUAL(), LIB_SYMBOL::Flatten(), SCH_PIN::GetAlt(), SCH_PIN::GetAlternates(), LIB_SYMBOL::GetGraphicalPins(), LIB_SYMBOL::GetLibId(), SCH_PIN::GetLibPin(), SCH_SYMBOL::GetLibSymbolRef(), SCH_SYMBOL::GetPins(), SCH_SYMBOL::GetRawPins(), SCH_PIN::GetType(), LINE, SCH_PIN::ALT::m_Name, SCH_PIN::ALT::m_Shape, SCH_PIN::ALT::m_Type, path, PT_NC, PT_POWER_IN, PT_UNSPECIFIED, SCH_SYMBOL::SetLibSymbol(), SCH_PIN::SetName(), SCH_PIN::SetNumber(), SCH_PIN::SetPosition(), SCH_SYMBOL::SetRef(), and SCH_PIN::SetType().
| BOOST_AUTO_TEST_CASE | ( | PinDangling | ) |
Check the pin dangling flag.
Definition at line 136 of file test_sch_pin.cpp.
References BOOST_CHECK_EQUAL().
| BOOST_AUTO_TEST_CASE | ( | PinNumbering | ) |
Check the pin labelling.
Definition at line 153 of file test_sch_pin.cpp.
References BOOST_CHECK_EQUAL(), name, and path.
| BOOST_AUTO_TEST_CASE | ( | PinNumberingPower | ) |
Check the pin labelling when it's a power pin.
Definition at line 169 of file test_sch_pin.cpp.
References BOOST_CHECK_EQUAL(), path, and PT_POWER_IN.