62 wxS(
"issue24409/issue24409.kicad_sch" );
64 for(
bool useEngine : {
false,
true } )
78 BOOST_REQUIRE_EQUAL( sheets.size(), 4u );
83 BOOST_REQUIRE_EQUAL( refs.
GetCount(), 6u );
85 std::set<wxString> seenRefs;
87 for(
size_t i = 0; i < refs.
GetCount(); ++i )
88 seenRefs.insert( refs[i].GetRef() );
90 BOOST_CHECK( seenRefs.count( wxS(
"R1" ) ) );
91 BOOST_CHECK( seenRefs.count( wxS(
"R2" ) ) );
92 BOOST_CHECK( seenRefs.count( wxS(
"R3" ) ) );
93 BOOST_CHECK( seenRefs.count( wxS(
"R4" ) ) );
94 BOOST_CHECK( seenRefs.count( wxS(
"R5" ) ) );
95 BOOST_CHECK( seenRefs.count( wxS(
"R6" ) ) );
106 sch->ConnectionGraph()->RunERC();
109 int unconnectedMarkers = 0;
110 std::set<wxString> markedRefs;
112 std::set<const SCH_SCREEN*> visitedScreens;
119 if( !visitedScreens.insert( screen ).second )
125 std::shared_ptr<ERC_ITEM> ercItem =
126 std::dynamic_pointer_cast<ERC_ITEM>( marker->
GetRCItem() );
131 ++unconnectedMarkers;
134 ? ercItem->GetSpecificSheetPath()
136 EDA_ITEM* erred = sch->ResolveItem( ercItem->GetMainItemID(),
nullptr,
true );
141 markedRefs.insert( parent->GetRef( &markerSheet ) );
149 BOOST_CHECK_MESSAGE( unconnectedMarkers == 4,
150 "Expected 4 deduplicated pin_not_connected markers, got "
151 << unconnectedMarkers );
157 for(
const wxString ref : { wxS(
"R1" ), wxS(
"R2" ) } )
159 BOOST_CHECK_MESSAGE( markedRefs.count( ref ),
160 "Missing pin_not_connected marker for " << ref
161 <<
" on the first sheet instance" );
164 for(
const wxString ref : { wxS(
"R3" ), wxS(
"R4" ), wxS(
"R5" ), wxS(
"R6" ) } )
166 BOOST_CHECK_MESSAGE( !markedRefs.count( ref ),
167 "Unexpected pin_not_connected marker for " << ref
168 <<
"; dedup should keep only the first instance" );
175 std::shared_ptr<SHEETLIST_ERC_ITEMS_PROVIDER> markersProvider =
176 std::make_shared<SHEETLIST_ERC_ITEMS_PROVIDER>( sch.get() );
182 for(
const wxString ref : { wxS(
"R1" ), wxS(
"R2" ) } )
184 BOOST_CHECK_MESSAGE( report.Contains( wxS(
"Symbol " ) + ref + wxS(
" " ) ),
185 "ERC text report missing pin_not_connected for "
186 << ref <<
"\n" << report );
189 for(
const wxString ref : { wxS(
"R3" ), wxS(
"R4" ), wxS(
"R5" ), wxS(
"R6" ) } )
191 BOOST_CHECK_MESSAGE( !report.Contains( wxS(
"Symbol " ) + ref + wxS(
" " ) ),
192 "ERC text report unexpectedly mentions "
193 << ref <<
"\n" << report );
static SCHEMATIC * LoadSchematic(const wxString &aFileName, bool aSetActive, bool aForceDefaultProject, PROJECT *aProject=nullptr, bool aCalculateConnectivity=true, REPORTER *aRootReporter=nullptr)
void GetSymbols(SCH_REFERENCE_LIST &aReferences, SYMBOL_FILTER aSymbolFilter, bool aForceIncludeOrphanSymbols=false) const
Add a SCH_REFERENCE object to aReferences for each symbol in the list of sheets.