78 m_schematic->ConnectionGraph()->RunERC();
88 "Expected 1 ERCE_GROUND_PIN_NOT_GROUND error but got "
92 bool foundGroundPinError =
false;
93 for(
unsigned i = 0; i < errors.
GetCount(); i++ )
97 foundGroundPinError =
true;
103 "Expected to find ERCE_GROUND_PIN_NOT_GROUND error\n"
129 m_schematic->ConnectionGraph()->RunERC();
139 int groundPinErrors = 0;
140 for(
unsigned i = 0; i < errors.
GetCount(); i++ )
149 "Expected 0 ERCE_GROUND_PIN_NOT_GROUND errors but got "
150 << groundPinErrors <<
"\n" << reportWriter.
GetTextReport() );
177 m_schematic->ConnectionGraph()->RunERC();
187 int groundPinErrors = 0;
188 for(
unsigned i = 0; i < errors.
GetCount(); i++ )
197 "Expected 1 ERCE_GROUND_PIN_NOT_GROUND error but got "
198 << groundPinErrors <<
"\n" << reportWriter.
GetTextReport() );
225 m_schematic->ConnectionGraph()->RunERC();
235 int groundPinErrors = 0;
236 for(
unsigned i = 0; i < errors.
GetCount(); i++ )
245 "Expected 0 ERCE_GROUND_PIN_NOT_GROUND errors but got "
246 << groundPinErrors <<
"\n" << reportWriter.
GetTextReport() );
267 int groundPinErrors = 0;
271 m_schematic->ConnectionGraph()->RunERC();
278 for(
unsigned i = 0; i < errors.
GetCount(); i++ )
287 "Expected 0 errors when test is disabled but got " << groundPinErrors );
291 m_schematic->ConnectionGraph()->RunERC();
299 for(
unsigned i = 0; i < errors.
GetCount(); i++ )
308 "Expected at least 1 error when test is enabled but got " << groundPinErrors );
332 m_schematic->ConnectionGraph()->RunERC();
340 bool foundGroundPinError =
false;
341 wxString errorMessage;
343 for(
unsigned i = 0; i < errors.
GetCount(); i++ )
347 foundGroundPinError =
true;
352 "Error message should contain 'Pin': " << errorMessage.ToStdString() );
355 "Error message should contain 'GND': " << errorMessage.ToStdString() );
358 "Error message should contain expected text: " << errorMessage.ToStdString() );
361 std::shared_ptr<RC_ITEM> ercItem = errors.
GetItem( i );
363 "ERC item should have a main item (the pin)" );
370 "Should have found a ground pin error to test message content" );
383 std::vector<std::pair<wxString, int>> tests =
385 {
"ground_pin_test_error", 1 },
386 {
"ground_pin_test_ok", 0 },
387 {
"ground_pin_test_mixed", 1 },
388 {
"ground_pin_test_no_ground_net", 0 }
391 for(
const std::pair<wxString, int>&
test : tests )
405 m_schematic->ConnectionGraph()->RunERC();
421 int groundPinErrors = 0;
422 for(
unsigned i = 0; i < errors.
GetCount(); i++ )
433 "Expected " <<
test.second <<
" ERCE_GROUND_PIN_NOT_GROUND errors in "
434 <<
test.first.ToStdString() <<
" but got " << groundPinErrors
wxString GetTextReport()
Returns the ERC report in "text" (human readable) format in the C-locale.
Container for ERC settings.
std::map< int, SEVERITY > m_ERCSeverities
int TestPinToPin()
Checks the full netlist against the pin-to-pin connectivity requirements.
int TestSimilarLabels()
Checks for labels that differ only in capitalization.
int TestMultUnitPinConflicts()
Checks if shared pins on multi-unit symbols have been connected to different nets.
int TestNoConnectPins()
In KiCad 5 and earlier, you could connect stuff up to pins with NC electrical type.
int TestGroundPins()
Checks for ground-labeled pins not on a ground net while another pin is.
int TestMissingUnits()
Test for uninstantiated units of multi unit symbols.
int TestMultiunitFootprints()
Test if all units of each multiunit symbol have the same footprint assigned.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
virtual wxString GetErrorMessage(bool aTranslate) const
An implementation of the RC_ITEM_LIST interface which uses the global SHEETLIST to fulfill the contra...
int GetCount(int aSeverity=-1) const override
void SetSeverities(int aSeverities) override
std::shared_ptr< RC_ITEM > GetItem(int aIndex) const override
Retrieve a RC_ITEM by index.
@ ERCE_GROUND_PIN_NOT_GROUND
A ground-labeled pin is not on a ground net while another pin is.
@ ERCE_LIB_SYMBOL_MISMATCH
Symbol doesn't match copy in library.
@ ERCE_LIB_SYMBOL_ISSUES
Symbol not found in active libraries.
void LoadSchematic(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic)
std::vector< FAB_LAYER_COLOR > dummy
SETTINGS_MANAGER m_settingsManager
std::unique_ptr< SCHEMATIC > m_schematic
ERC_GROUND_PIN_TEST_FIXTURE()
BOOST_FIXTURE_TEST_CASE(ERCGroundPinMismatch, ERC_GROUND_PIN_TEST_FIXTURE)
Test case: Pin with "GND" in its name connected to non-ground net while another pin in the same symbo...
BOOST_CHECK_MESSAGE(totalMismatches==0, std::to_string(totalMismatches)+" board(s) with strategy disagreements")