39 for(
bool backend : {
false,
true } )
45 std::unique_ptr<SCHEMATIC> schematic;
47 std::vector<SCH_SHEET_PATH> paths;
51 if(
path.LastScreen()->GetFileName().EndsWith(
"ampli_ht.kicad_sch" ) )
52 paths.push_back(
path );
55 BOOST_REQUIRE_EQUAL( paths.size(), 2 );
62 auto* candidate =
static_cast<SCH_SYMBOL*
>( item );
64 if( candidate->GetUnitCount() > 1 )
76 for(
const auto& candidate : symbol->
GetRawPins() )
78 if( candidate->GetNumber() == wxString(
"5" ) )
80 pin = candidate.get();
86 BOOST_REQUIRE_EQUAL(
pin->GetUnit(), 2 );
87 pin->SetNumber(
"1[" );
89 pin->GetStackedPinNumbers( &valid );
91 screen->
Update( symbol,
false );
92 schematic->RebuildConnectivity();
93 schematic->SetCurrentSheet( paths[0] );
100 auto* marker =
static_cast<SCH_MARKER*
>( item );
101 const auto error = std::static_pointer_cast<ERC_ITEM>( marker->GetRCItem() );
107 BOOST_CHECK( error->IsSheetSpecific() );
109 if( error->IsSheetSpecific() )
110 BOOST_CHECK( error->GetSpecificSheetPath().PathRef() == paths[1].PathRef() );
112 BOOST_CHECK( marker->GetPosition() ==
pin->GetPosition() );
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
EE_TYPE OfType(KICAD_T aType) const
Runs the electrical rules checks and adds a SCH_MARKER for each violation.
int TestStackedPinNotation()
Checks for pin numbers that resemble stacked pin notation but are invalid.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
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.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
std::vector< std::unique_ptr< SCH_PIN > > & GetRawPins()
void SetUnitSelection(const SCH_SHEET_PATH *aSheet, int aUnitSelection)
Set the selected unit of this symbol on one sheet.
RAII class that sets an value at construction and resets it to the original value at destruction.
@ ERCE_STACKED_PIN_SYNTAX
Pin name resembles stacked pin notation.
void LoadSchematic(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic)
BOOST_AUTO_TEST_CASE(ERCStackedPinSyntaxUsesSharedInstanceUnits)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_TEST_CONTEXT("Test Clearance")
BOOST_CHECK_EQUAL(result, "25.4")