74 if(
pin->GetNumber() == aNumber )
98 fn.AppendDir( wxS(
"issue22286" ) );
99 fn.SetName( wxS(
"bugtest" ) );
105 SCH_SYMBOL* j1 = FindSymbolByRef( wxS(
"J1" ) );
106 BOOST_REQUIRE_MESSAGE( j1 !=
nullptr,
"Symbol J1 not found in schematic" );
109 SCH_PIN* pin8 = FindPinByNumber( j1, wxS(
"8" ) );
110 BOOST_REQUIRE_MESSAGE( pin8 !=
nullptr,
"Pin 8 not found on symbol J1" );
113 BOOST_CHECK_MESSAGE( pin8->
GetAlt() == wxS(
"8.pow" ),
114 "Pin 8 should have alternate '8.pow' set, but has '"
118 BOOST_CHECK_MESSAGE( pin8->
GetLibPin() !=
nullptr,
119 "Pin 8 should have m_libPin set after schematic load" );
125 BOOST_CHECK_MESSAGE( !alternates.empty(),
126 "Library pin should have alternates populated" );
127 BOOST_CHECK_MESSAGE( alternates.count( wxS(
"8.pow" ) ) > 0,
128 "Library pin should have '8.pow' in alternates map" );
131 if( alternates.count( wxS(
"8.pow" ) ) > 0 )
133 const SCH_PIN::ALT& alt = alternates.at( wxS(
"8.pow" ) );
135 "Library pin alternate '8.pow' should have type PT_POWER_IN" );
142 "Pin 8 GetType() should return PT_POWER_IN (7) for alternate '8.pow', "
143 "but returned " + std::to_string(
static_cast<int>( pinType ) )
147 BOOST_CHECK_MESSAGE( pin8->
GetShownName() == wxS(
"8.pow" ),
148 "Pin 8 GetShownName() should return '8.pow', but returned '"
165 fn.AppendDir( wxS(
"issue22286" ) );
166 fn.SetName( wxS(
"bugtest" ) );
171 SCH_SYMBOL* j1 = FindSymbolByRef( wxS(
"J1" ) );
174 SCH_PIN* pin8 = FindPinByNumber( j1, wxS(
"8" ) );
184 BOOST_CHECK_MESSAGE( !netName.StartsWith( wxS(
"unconnected-(" ) ),
185 "Pin 8 (power_in) should not get an 'unconnected-(...)' name. "
186 "Got: '" + netName +
"'" );
EE_TYPE OfType(KICAD_T aType) const
A generic fixture for loading schematics and associated settings for qa tests.
std::unique_ptr< SCHEMATIC > m_schematic
Base class for any item which can be embedded within the SCHEMATIC container class,...
const std::map< wxString, ALT > & GetAlternates() const
ALT GetAlt(const wxString &aAlt)
SCH_PIN * GetLibPin() const
const wxString & GetShownName() const
wxString GetDefaultNetName(const SCH_SHEET_PATH &aPath, bool aForceNoConnect=false)
ELECTRICAL_PINTYPE GetType() const
EE_RTREE & Items()
Get the full RTree, usually for iterating.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
std::vector< const SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet) const
Retrieve a list of the SCH_PINs for the given sheet path.
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
SCH_SYMBOL * FindSymbolByRef(const wxString &aRef)
SCH_PIN * FindPinByNumber(SCH_SYMBOL *aSymbol, const wxString &aNumber)
static const std::string KiCadSchematicFileExtension
std::string GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
ELECTRICAL_PINTYPE
The symbol library pin object electrical types used in ERC tests.
@ PT_POWER_IN
power input (GND, VCC for ICs). Must be connected to a power output.
wxString ElectricalPinTypeGetText(ELECTRICAL_PINTYPE)
static void LoadSchematic(SCHEMATIC *aSchematic, SCH_SHEET *aRootSheet, const wxString &aFileName)
ELECTRICAL_PINTYPE m_Type
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(PinAlternateTypeAfterSchematicLoad)
Test that pin alternates are correctly applied after loading a schematic from disk.
Definition of file extensions used in Kicad.