21#include <boost/test/unit_test.hpp>
44 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
49 bool foundFourNetSignal =
false;
50 for(
const auto& sig : netChains )
52 if( sig && sig->GetNets().size() == 4 )
54 foundFourNetSignal =
true;
60 "Expected at least one signal composed of exactly 4 nets to be built" );
67 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
72 bool foundLabeled =
false;
73 for(
const auto& sig : netChains )
78 wxString
name = sig->GetName();
79 if(
name.StartsWith( wxString(
"/" ) ) )
82 if( sig->GetNets().size() == 4 &&
name == wxString(
"SIG" ) )
90 "Expected a 4-net signal named 'SIG' to be built from label" );
97 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
106 bool mainSignalExcludesVCC =
false;
107 for(
const auto& sig : netChains )
112 const auto& nets = sig->GetNets();
114 if( nets.size() < 2 )
117 bool containsVCC =
false;
118 for(
const wxString& n : nets )
122 if( nn.StartsWith( wxString(
"/" ) ) )
125 if( nn.CmpNoCase( wxString(
"VCC" ) ) == 0 )
134 mainSignalExcludesVCC =
true;
140 "Expected at least one multi-net signal that does not include VCC "
141 "(power branch should not be merged into the main signal)" );
148 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
157 bool mainSignalExcludesGND =
false;
158 for(
const auto& sig : netChains )
163 const auto& nets = sig->GetNets();
165 if( nets.size() < 2 )
168 bool containsGND =
false;
169 for(
const wxString& n : nets )
173 if( nn.StartsWith( wxString(
"/" ) ) )
176 if( nn.CmpNoCase( wxString(
"GND" ) ) == 0 )
185 mainSignalExcludesGND =
true;
191 "Expected at least one multi-net signal that does not include GND "
192 "(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")