107 PCB_DIFFER differ( m_ancestor.get(), m_ours.get(), wxS(
"complex_hierarchy.kicad_pcb" ) );
121 m_ours->GetDesignSettings().m_NetSettings->GetDefaultNetclass()->SetClearance( 350000 );
123 PCB_DIFFER differ( m_ancestor.get(), m_ours.get(), wxS(
"complex_hierarchy.kicad_pcb" ) );
132 BOOST_CHECK(
delta->before.ToDisplayString() !=
delta->after.ToDisplayString() );
139 std::shared_ptr<NETCLASS> hs = std::make_shared<NETCLASS>( wxS(
"HighSpeed" ),
false );
140 hs->SetClearance( 150000 );
141 hs->SetTrackWidth( 127000 );
143 std::map<wxString, std::shared_ptr<NETCLASS>> classes =
144 m_ours->GetDesignSettings().m_NetSettings->GetNetclasses();
145 classes[wxS(
"HighSpeed" )] = hs;
146 m_ours->GetDesignSettings().m_NetSettings->SetNetclasses( classes );
148 PCB_DIFFER differ( m_ancestor.get(), m_ours.get(), wxS(
"complex_hierarchy.kicad_pcb" ) );
157 BOOST_CHECK(
delta->before.ToDisplayString() !=
delta->after.ToDisplayString() );
166 m_ours->GetDesignSettings().m_NetSettings->GetDefaultNetclass()->SetClearance( 350000 );
168 PCB_DIFFER diffAO( m_ancestor.get(), m_ours.get(), wxS(
"complex_hierarchy.kicad_pcb" ) );
169 PCB_DIFFER diffAT( m_ancestor.get(), m_theirs.get(), wxS(
"complex_hierarchy.kicad_pcb" ) );
178 std::unique_ptr<BOARD> merged = applier.
Apply();
185 merged->GetDesignSettings().m_NetSettings->GetDefaultNetclass()->GetClearance(),
190 BOOST_CHECK( merged->GetDesignSettings().m_NetSettings.get()
191 != m_ours->GetDesignSettings().m_NetSettings.get() );
194 m_ours->GetDesignSettings().m_NetSettings->GetDefaultNetclass()->SetClearance( 999999 );
197 merged->GetDesignSettings().m_NetSettings->GetDefaultNetclass()->GetClearance(),
207 m_theirs->GetDesignSettings().m_NetSettings->GetDefaultNetclass()->SetTrackWidth( 300000 );
209 PCB_DIFFER diffAO( m_ancestor.get(), m_ours.get(), wxS(
"complex_hierarchy.kicad_pcb" ) );
210 PCB_DIFFER diffAT( m_ancestor.get(), m_theirs.get(), wxS(
"complex_hierarchy.kicad_pcb" ) );
219 std::unique_ptr<BOARD> merged = applier.
Apply();
224 merged->GetDesignSettings().m_NetSettings->GetDefaultNetclass()->GetTrackWidth(),
Three-way merge plan generator.
MERGE_PLAN Plan(const DOCUMENT_DIFF &aAncestorOurs, const DOCUMENT_DIFF &aAncestorTheirs) const
Plan the merge given the canonical pair of diffs.
Diff two already-parsed BOARDs and produce a DOCUMENT_DIFF.
DOCUMENT_DIFF Diff() override
Produce a DOCUMENT_DIFF of the inputs the concrete differ was constructed with.
Materialize a MERGE_PLAN into a real merged BOARD.
std::unique_ptr< BOARD > Apply()
Produce the merged board.
const REPORT & GetReport() const
const wxString DOC_PROP_NET_CLASSES
void LoadBoard(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< BOARD > &aBoard)
The full set of changes between two parsed documents of one type.
std::vector< ITEM_CHANGE > changes
One change record on a single item.
std::vector< PROPERTY_DELTA > properties
Result of planning a 3-way merge.
bool projectFileTouched
True iff the applier resolved state that lives in the .kicad_pro or a project sibling file.
Single (name, before, after) triple for one mutated property on an item.
Fixture: three independent loads of the same canonical board, used to play the role of ancestor / our...
SETTINGS_MANAGER m_settingsTheirs
std::unique_ptr< BOARD > m_theirs
NET_CLASSES_DIFF_MERGE_FIXTURE()
SETTINGS_MANAGER m_settingsOurs
SETTINGS_MANAGER m_settingsAnc
std::unique_ptr< BOARD > m_ancestor
std::unique_ptr< BOARD > m_ours
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
static const ITEM_CHANGE * findDocLevelChange(const DOCUMENT_DIFF &aDiff)
Find the synthetic doc-level ITEM_CHANGE (empty KIID_PATH) in a diff result, returning nullptr if non...
BOOST_AUTO_TEST_CASE(NoChangeEmitsNoNetClassesDelta)
static const PROPERTY_DELTA * findProperty(const ITEM_CHANGE &aChange, const wxString &aName)
wxString result
Test unit parsing edge cases and error handling.
BOOST_CHECK_EQUAL(result, "25.4")