20#include <boost/test/unit_test.hpp>
43 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
48 bool foundFourNetSignal =
false;
49 for(
const auto& sig : netChains )
51 if( sig && sig->GetNets().size() == 4 )
53 foundFourNetSignal =
true;
59 "Expected at least one signal composed of exactly 4 nets to be built" );
66 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
71 bool foundLabeled =
false;
72 for(
const auto& sig : netChains )
77 wxString
name = sig->GetName();
78 if(
name.StartsWith( wxString(
"/" ) ) )
81 if( sig->GetNets().size() == 4 &&
name == wxString(
"SIG" ) )
89 "Expected a 4-net signal named 'SIG' to be built from label" );
96 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
105 bool mainSignalExcludesVCC =
false;
106 for(
const auto& sig : netChains )
111 const auto& nets = sig->GetNets();
113 if( nets.size() < 2 )
116 bool containsVCC =
false;
117 for(
const wxString& n : nets )
121 if( nn.StartsWith( wxString(
"/" ) ) )
124 if( nn.CmpNoCase( wxString(
"VCC" ) ) == 0 )
133 mainSignalExcludesVCC =
true;
139 "Expected at least one multi-net signal that does not include VCC "
140 "(power branch should not be merged into the main signal)" );
147 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
156 bool mainSignalExcludesGND =
false;
157 for(
const auto& sig : netChains )
162 const auto& nets = sig->GetNets();
164 if( nets.size() < 2 )
167 bool containsGND =
false;
168 for(
const wxString& n : nets )
172 if( nn.StartsWith( wxString(
"/" ) ) )
175 if( nn.CmpNoCase( wxString(
"GND" ) ) == 0 )
184 mainSignalExcludesGND =
true;
190 "Expected at least one multi-net signal that does not include GND "
191 "(power branch should not be merged into the main signal)" );
Calculate the connectivity of a schematic and generates netlists.
void Recalculate(const SCH_SHEET_LIST &aSheetList, bool aUnconditional=false, std::function< void(SCH_ITEM *)> *aChangedItemHandler=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr)
Update the connection graph for the given list of sheets.
const std::vector< std::unique_ptr< SCH_NETCHAIN > > & GetPotentialNetChains() const
Potential net chains are inferred groupings produced by RebuildNetChains() but not yet user-committed...
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
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
BOOST_FIXTURE_TEST_CASE(RebuildSignals_GroupsFourNetsIntoOneSignal, SIGNALS_TEST_FIXTURE)
BOOST_CHECK_MESSAGE(totalMismatches==0, std::to_string(totalMismatches)+" board(s) with strategy disagreements")