39 std::unique_ptr<SCHEMATIC> schematic;
44 std::unique_ptr<SCH_LINE> wire;
49 wire.reset(
static_cast<SCH_LINE*
>( item->Duplicate(
false ) ) );
54 auto* symbol =
static_cast<SCH_SYMBOL*
>( item );
56 if( symbol->IsPower() )
59 for(
SCH_PIN* candidate : symbol->GetPins( &
path ) )
61 if( candidate->IsGlobalPower() && !candidate->IsVisible()
72 auto* symbol =
static_cast<SCH_SYMBOL*
>(
pin->GetParentSymbol() );
76 screen->
Update( symbol,
false );
78 wire->SetStartPoint( position );
79 wire->SetEndPoint( position +
VECTOR2I( 1000000, 0 ) );
80 screen->
Append( wire.release() );
82 for(
auto& [code, severity] : schematic->ErcSettings().m_ERCSeverities )
86 schematic->RebuildConnectivity();
87 const auto collect = [&]()
90 std::vector<SCH_MARKER*>
result;
91 std::vector<SCH_ITEM*> markers;
95 auto* marker =
static_cast<SCH_MARKER*
>( item );
98 && marker->GetRCItem()->GetMainItemID() ==
pin->m_Uuid )
100 result.push_back( marker );
103 markers.push_back( item );
106 return std::make_pair(
result, markers );
109 const auto [found, all] = collect();
110 BOOST_REQUIRE_EQUAL( found.size(), 1 );
111 BOOST_CHECK( found.front()->GetPosition() == position );
117 BOOST_CHECK( collect().first.empty() );
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
EE_TYPE OfType(KICAD_T aType) const
static int TestConnectivity(SCHEMATIC &aSchematic)
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,...
Segment description base class to describe items which have 2 end points (track, wire,...
void Append(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
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...
void SetPosition(const VECTOR2I &aPosition) override
RAII class that sets an value at construction and resets it to the original value at destruction.
@ ERCE_WIRED_IMPLICIT_POWER
Wired hidden power input also joins its global net by name.
void LoadSchematic(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic)
@ PT_POWER_IN
power input (GND, VCC for ICs). Must be connected to a power output.
BOOST_AUTO_TEST_CASE(ERCWiredImplicitPowerReportsWiredHiddenPin)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
wxString result
Test unit parsing edge cases and error handling.
VECTOR2< int32_t > VECTOR2I