49static const wxString
LED0_PATH = wxS(
"/17c4bf89-456c-4209-aa21-31be7397f5ca"
50 "/adf4c8f0-c33f-488a-8e8d-4ca6638d0792"
51 "/fd71c97e-9deb-4a95-a605-8e0c9eaa9729" );
54static const wxString
LED8_PATH = wxS(
"/17c4bf89-456c-4209-aa21-31be7397f5ca"
55 "/adf4c8f0-c33f-488a-8e8d-4ca6638d0792"
56 "/af5bb00b-cab5-44ce-9731-12dfdbf0dd8b" );
66 fn.AppendDir( wxS(
"issue21821" ) );
67 fn.SetName( wxS(
"issue21821" ) );
83 "The two sub-sheets must share one screen for this test to mean "
113 BOOST_REQUIRE_EQUAL( m_diode->GetRef( &m_led0Path ), wxS(
"D3" ) );
114 BOOST_REQUIRE_EQUAL( m_diode->GetRef( &m_led8Path ), wxS(
"D33" ) );
123 BOOST_CHECK_EQUAL( instance.m_ProjectName, m_schematic->Project().GetProjectName() );
138 if( symbol == m_diode )
142 wxString led0Before = symbol->
GetRef( &m_led0Path );
143 wxString led8Before = symbol->
GetRef( &m_led8Path );
154 BOOST_CHECK( examined > 0 );
167 std::vector<SCH_SYMBOL_INSTANCE> stored = m_diode->GetInstances();
169 BOOST_REQUIRE_EQUAL( stored.size(), 2 );
174 withVirtualRoot.push_back(
niluuid );
176 for(
const KIID& uuid : instance.m_Path )
177 withVirtualRoot.push_back( uuid );
179 m_diode->RemoveInstance( instance.m_Path );
180 instance.m_Path = withVirtualRoot;
184 m_diode->AddHierarchicalReference( instance );
188 BOOST_REQUIRE_EQUAL( m_diode->GetInstances().size(), 2 );
196 BOOST_CHECK( instance.m_Path.front() ==
niluuid );
197 BOOST_CHECK_EQUAL( instance.m_ProjectName, m_schematic->Project().GetProjectName() );
199 if( instance.m_Path.back() == m_led0Path.Path().back() )
200 led0Ref = instance.m_Reference;
201 else if( instance.m_Path.back() == m_led8Path.Path().back() )
202 led8Ref = instance.m_Reference;
217 foreign.
m_Path =
KIID_PATH( wxS(
"/2b1cb0b9-6a97-4b3a-9c9e-24d5f2a0a9d1"
218 "/9d0f1e5c-4a6b-4f0d-8f4a-1c2d3e4f5a6b" ) );
222 m_diode->AddHierarchicalReference( foreign );
225 pathless.
m_ProjectName = m_schematic->Project().GetProjectName();
228 m_diode->AddHierarchicalReference( pathless );
230 BOOST_REQUIRE_EQUAL( m_diode->GetInstances().size(), 4 );
237 BOOST_CHECK( instance.m_Path == m_led0Path.Path() || instance.m_Path == m_led8Path.Path() );
A generic fixture for loading schematics and associated settings for qa tests.
std::unique_ptr< SCHEMATIC > m_schematic
virtual void LoadSchematic(const wxFileName &aFn)
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
virtual const wxString & GetText() const override
Return the string associated with the text object.
Base class for any item which can be embedded within the SCHEMATIC container class,...
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
std::optional< SCH_SHEET_PATH > GetSheetPathByKIIDPath(const KIID_PATH &aPath, bool aIncludeLastSheet=true) const
Finds a SCH_SHEET_PATH that matches the provided KIID_PATH.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
const std::vector< SCH_SYMBOL_INSTANCE > & GetInstances() const
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
static const std::string KiCadSchematicFileExtension
std::string GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
std::vector< FAB_LAYER_COLOR > dummy
SCH_SHEET_PATH m_led8Path
SCH_SHEET_PATH m_led0Path
A simple container for schematic symbol instance information.
@ VALUE
Field Value of part, i.e. "3.3K".
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
static const wxString LED8_PATH
Sheet path of the "dual gpio LED8" instance, which shares LED0's screen.
static const wxString LED0_PATH
Sheet path of the "dual gpio LED0" instance, taken from the reporter's files.
BOOST_FIXTURE_TEST_CASE(SharedScreenInstancesSurvivePaste, ISSUE21821_FIXTURE)
The diode's instances are stored with no project name, so keying the paste cleanup on the project nam...
BOOST_CHECK_EQUAL(result, "25.4")