42 for(
bool backend : {
false,
true } )
46 std::unique_ptr<SCHEMATIC> schematic;
50 std::vector<SCH_ITEM*> removed;
57 removed.push_back( item );
65 const auto pins = child->
GetPins();
74 child->
GetFields().back().SetText(
"MissingRootClass" );
75 screen->
Update( child,
false );
76 schematic->RebuildConnectivity();
81 schematic->ConnectionGraph()->Reset();
89 const auto* marker =
static_cast<SCH_MARKER*
>( item );
90 const auto error = std::static_pointer_cast<ERC_ITEM>( marker->GetRCItem() );
95 BOOST_CHECK( error->GetMainItemID() == child->
m_Uuid );
96 BOOST_CHECK( marker->GetPosition() == child->
GetPosition() );
98 BOOST_CHECK( error->GetSpecificSheetPath().PathRef() == root.
PathRef() );
99 BOOST_CHECK( error->GetErrorMessage(
true ).Contains(
"MissingRootClass" ) );
114 for(
bool backend : {
false,
true } )
120 std::unique_ptr<SCHEMATIC> schematic;
122 std::vector<SCH_SHEET_PATH> paths;
126 if(
path.LastScreen()->GetFileName().EndsWith(
"ampli_ht.kicad_sch" ) )
127 paths.push_back(
path );
130 BOOST_REQUIRE_EQUAL( paths.size(), 2 );
144 const wxString variant(
"Netclass variant" );
145 schematic->AddVariant( variant );
146 symbol->
SetFieldText(
"Netclass",
"MissingVariantClass", &paths[0], variant );
147 screen->
Update( symbol,
false );
148 schematic->SetCurrentVariant( variant );
152 wxString(
"MissingVariantClass" ) );
154 schematic->RebuildConnectivity();
157 schematic->ConnectionGraph()->Reset();
161 std::vector<SCH_ITEM*> markers;
165 const auto* marker =
static_cast<SCH_MARKER*
>( item );
166 const auto error = std::static_pointer_cast<ERC_ITEM>( marker->GetRCItem() );
171 BOOST_CHECK( error->GetMainItemID() == symbol->
m_Uuid );
173 BOOST_CHECK( error->GetSpecificSheetPath().PathRef() == paths[0].PathRef() );
174 BOOST_CHECK( error->GetErrorMessage(
true ).Contains(
"MissingVariantClass" ) );
175 markers.push_back( item );
183 schematic->SetCurrentVariant( wxString() );
184 schematic->RebuildConnectivity();
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
KICAD_T Type() const
Returns the type of object.
EE_TYPE OfType(KICAD_T aType) const
Runs the electrical rules checks and adds a SCH_MARKER for each violation.
int TestMissingNetclasses()
Tests for netclasses that are referenced but not defined.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
wxString GetShownText(const SCH_SHEET_PATH *aPath, RESOLUTION_CONTEXT aContext, const wxString &aVariantName=wxEmptyString, int aDepth=0) const
void SetText(const wxString &aText) override
Base class for any item which can be embedded within the SCHEMATIC container class,...
EE_RTREE & Items()
Get the full RTree, usually for iterating.
void Update(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
Refresh a changed item in the tree and invalidate connectivity.
void DeleteItem(SCH_ITEM *aItem)
Remove aItem from the linked list and deletes the object.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
SCH_SCREEN * LastScreen()
const KIID_PATH & PathRef() const
Borrow the cached path until this sheet path is modified or destroyed.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
std::vector< SCH_FIELD > & GetFields()
Return a reference to the vector holding the sheet's fields.
void RemovePin(const SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
VECTOR2I GetPosition() const override
std::vector< SCH_SHEET_PIN * > & GetPins()
void SetFieldText(const wxString &aFieldName, const wxString &aFieldText, const SCH_SHEET_PATH *aPath=nullptr, const wxString &aVariantName=wxEmptyString)
SCH_FIELD * AddField(const SCH_FIELD &aField)
Add a field to the symbol.
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
RAII class that sets an value at construction and resets it to the original value at destruction.
@ ERCE_UNDEFINED_NETCLASS
A netclass was referenced but not defined.
void LoadSchematic(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic)
@ USER
The field ID hasn't been set yet; field is invalid.
BOOST_AUTO_TEST_CASE(ERCMissingNetclassesIncludeSheetsWithoutElectricalIslands)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_TEST_CONTEXT("Test Clearance")
BOOST_CHECK_EQUAL(result, "25.4")