45 for(
int i = 0; i < aErrors.
GetCount(); ++i )
47 std::shared_ptr<ERC_ITEM> ercItem = std::static_pointer_cast<ERC_ITEM>( aErrors.
GetItem( i ) );
49 if( ercItem && ercItem->GetErrorCode() == aErrorCode )
62 std::vector<std::pair<wxString, int>> tests = { {
"issue16897", 3 } };
64 for(
const std::pair<wxString, int>&
test : tests )
80 m_schematic->ConnectionGraph()->RunERC();
90 "Expected " <<
test.second <<
" errors in " <<
test.first.ToStdString()
91 <<
" but got " << errors.
GetCount() <<
"\n"
102 std::vector<std::pair<wxString, int>> tests = { {
"same_local_global_label", 1 } };
104 for(
const std::pair<wxString, int>&
test : tests )
118 m_schematic->ConnectionGraph()->RunERC();
128 "Expected " <<
test.second <<
" errors in " <<
test.first.ToStdString()
129 <<
" but got " << errors.
GetCount() <<
"\n"
150 m_schematic->ConnectionGraph()->RunERC();
160 "Expected 2 ERCE_SAME_LOCAL_GLOBAL_POWER violations\n"
164 "Expected 0 ERCE_SAME_LOCAL_GLOBAL_LABEL violations\n"
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 TestSimilarLabels()
Checks for labels that differ only in capitalization.
int TestSameLocalGlobalLabel()
Checks for global and local labels with the same name.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
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_SIMILAR_POWER
2 power pins are equal for case insensitive comparisons.
@ ERCE_SIMILAR_LABELS
2 labels are equal for case insensitive comparisons.
@ ERCE_SAME_LOCAL_GLOBAL_LABEL
2 labels are equal for case insensitive comparisons.
@ ERCE_SIMILAR_LABEL_AND_POWER
label and pin are equal for case insensitive comparisons.
@ ERCE_SAME_LOCAL_GLOBAL_POWER
Local power port and global power port have the same name.
@ 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
std::unique_ptr< SCHEMATIC > m_schematic
SETTINGS_MANAGER m_settingsManager
ERC_REGRESSION_TEST_FIXTURE()
static int CountErrorCode(SHEETLIST_ERC_ITEMS_PROVIDER &aErrors, int aErrorCode)
BOOST_FIXTURE_TEST_CASE(ERCLabelCapitalization, ERC_REGRESSION_TEST_FIXTURE)
BOOST_CHECK_MESSAGE(totalMismatches==0, std::to_string(totalMismatches)+" board(s) with strategy disagreements")