38 std::unique_ptr<FOOTPRINT> footprint = std::make_unique<FOOTPRINT>(
nullptr );
40 for(
const wxString&
name : aNames )
42 std::unique_ptr<PAD>
pad = std::make_unique<PAD>( footprint.get() );
46 footprint->Add(
pad.release() );
74 std::vector<APNP_CASE> cases;
76 auto opts = std::make_unique<ARRAY_GRID_OPTIONS>();
79 opts->m_2dArrayNumbering =
false;
80 opts->m_pri_axis.SetOffset( 1 );
84 "Simple linear, skip some",
88 {
"2",
"4",
"5",
"6",
"7" },
92 opts = std::make_unique<ARRAY_GRID_OPTIONS>();
95 opts->m_2dArrayNumbering =
false;
96 opts->m_pri_axis.SetOffset( 1 );
100 "Simple linear, no footprint",
104 {
"1",
"2",
"3",
"4",
"5" },
120 std::vector<wxString> aExpectedNumbers )
122 std::vector<wxString> got_numbers;
124 for(
unsigned i = 0; i < aExpectedNumbers.size(); ++i )
127 BOOST_CHECK_EQUAL_COLLECTIONS( aExpectedNumbers.begin(), aExpectedNumbers.end(),
128 got_numbers.begin(), got_numbers.end() );
136 BOOST_TEST_CONTEXT( c.m_case_name )
138 std::unique_ptr<FOOTPRINT> footprint;
140 if( c.m_using_footprint )
@ NUMBERING_NUMERIC
Arabic numerals: 0,1,2,3,4,5,6,7,8,9,10,11...
Simple class that sequentially provides numbers from an ARRAY_OPTIONS object, making sure that they d...
wxString GetNextPadNumber()
Get the next available pad name.
std::unique_ptr< ARRAY_OPTIONS > m_arr_opts
std::vector< wxString > m_expected_numbers
std::vector< wxString > m_existing_pads
std::vector< APNP_CASE > GetFootprintAPNPCases()
Get Array Pad Name Provider cases when a footprint is looked at to determine what names are available...
BOOST_AUTO_TEST_CASE(FootprintCases)
void CheckPadNumberProvider(ARRAY_PAD_NUMBER_PROVIDER &aProvider, std::vector< wxString > aExpectedNumbers)
Check that an ARRAY_PAD_NUMBER_PROVIDER provides the right names.
static std::unique_ptr< FOOTPRINT > FootprintWithPads(const std::vector< wxString > aNames)
Make a footprint with a given list of named pads.
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_SUITE_END()