20#define BOOST_TEST_NO_MAIN
21#include <boost/test/unit_test.hpp>
44 void SelectConflict(
int aIndex )
46 m_listConflicts->SetSelection( aIndex );
48 OnConflictSelected( event );
51 void Choose( wxRadioButton* aChoice )
53 aChoice->SetValue(
true );
55 OnResolutionChanged( event );
60struct MERGE_DIALOG_FIXTURE
63 TEST_MERGE_DIALOG* dialog =
nullptr;
65 ~MERGE_DIALOG_FIXTURE()
81 for(
int i = 0; i < 3; ++i )
84 action.
id.push_back(
KIID() );
85 plan.unresolved.push_back( action.
id );
86 plan.actions.push_back( action );
89 dialog =
new TEST_MERGE_DIALOG(
plan );
96BOOST_FIXTURE_TEST_SUITE( MergeDialog, MERGE_DIALOG_FIXTURE )
101 if( !CreateDialog() )
105 BOOST_CHECK( dialog->m_radioUnresolved->GetValue() );
106 BOOST_CHECK( !dialog->m_radioOurs->GetValue() );
107 BOOST_CHECK( !dialog->m_radioTheirs->GetValue() );
108 BOOST_CHECK( !dialog->m_radioAncestor->GetValue() );
109 BOOST_CHECK( !dialog->m_sdbSizerApply->IsEnabled() );
118 if( !CreateDialog() )
121 dialog->Choose( dialog->m_radioOurs );
124 dialog->SelectConflict( 1 );
125 BOOST_CHECK( dialog->m_radioUnresolved->GetValue() );
126 BOOST_CHECK( !dialog->m_radioOurs->GetValue() );
127 BOOST_CHECK( !dialog->m_radioTheirs->GetValue() );
128 BOOST_CHECK( !dialog->m_radioAncestor->GetValue() );
130 BOOST_CHECK( !dialog->m_sdbSizerApply->IsEnabled() );
132 dialog->SelectConflict( 0 );
133 BOOST_CHECK( dialog->m_radioOurs->GetValue() );
134 BOOST_CHECK( !dialog->m_radioUnresolved->GetValue() );
141 if( !CreateDialog() )
144 dialog->Choose( dialog->m_radioOurs );
145 BOOST_CHECK( !dialog->m_sdbSizerApply->IsEnabled() );
147 dialog->SelectConflict( 1 );
148 dialog->Choose( dialog->m_radioTheirs );
150 BOOST_CHECK( !dialog->m_sdbSizerApply->IsEnabled() );
152 dialog->SelectConflict( 2 );
153 dialog->Choose( dialog->m_radioAncestor );
155 BOOST_CHECK( dialog->m_sdbSizerApply->IsEnabled() );
157 dialog->SelectConflict( 0 );
158 dialog->Choose( dialog->m_radioUnresolved );
160 BOOST_CHECK( !dialog->m_sdbSizerApply->IsEnabled() );
162 dialog->Choose( dialog->m_radioOurs );
163 BOOST_CHECK( dialog->m_sdbSizerApply->IsEnabled() );
wxRadioButton * m_radioTheirs
wxRadioButton * m_radioAncestor
wxRadioButton * m_radioUnresolved
wxRadioButton * m_radioOurs
wxListBox * m_listConflicts
Resolve a three-way merge by choosing a version for each conflicting item.
RAII helper that sets a process-level environment variable for the lifetime of the object.
static std::vector< PENDING_PROPERTY > plan(const EDA_ITEM &aSource, const EDA_ITEM &aTarget, const std::set< wxString > &aEnabledKeys)
Target properties to write, paired with values read off the source.
bool CanDoDisplayTests()
Some tests on some platforms require a display connection to run.
Result of planning a 3-way merge.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_CASE(ConflictsStartUnresolved)
BOOST_AUTO_TEST_SUITE_END()
BOOST_TEST_MESSAGE("Polyline has "<< chain.PointCount()<< " points")
BOOST_CHECK_EQUAL(result, "25.4")