KiCad PCB EDA Suite
test_lib_part.cpp File Reference

Test suite for LIB_SYMBOL. More...

Go to the source code of this file.

Classes

class  TEST_LIB_SYMBOL_FIXTURE
 
struct  TEST_LIB_SYMBOL_SUBREF_CASE
 

Functions

 BOOST_AUTO_TEST_CASE (DefaultProperties)
 Declare the test suite. More...
 
 BOOST_AUTO_TEST_CASE (DefaultDrawings)
 Check the drawings on a "blank" LIB_SYMBOL. More...
 
 BOOST_AUTO_TEST_CASE (DefaultFields)
 Check the default fields are present as expected. More...
 
 BOOST_AUTO_TEST_CASE (AddedFields)
 Test adding fields to a LIB_SYMBOL. More...
 
 BOOST_AUTO_TEST_CASE (AddedDrawItems)
 Test adding draw items to a LIB_SYMBOL. More...
 
 BOOST_AUTO_TEST_CASE (SubReference)
 Test the subreference indexing. More...
 
 BOOST_AUTO_TEST_CASE (Compare)
 Check the compare method. More...
 
 BOOST_AUTO_TEST_CASE (GetUnitItems)
 Check the fetch unit items code. More...
 
 BOOST_AUTO_TEST_CASE (GetUnitDrawItems)
 Check the fetch unit draw items code. More...
 
 BOOST_AUTO_TEST_CASE (Inheritance)
 Check inheritance support. More...
 
 BOOST_AUTO_TEST_CASE (CopyConstructor)
 Check the copy constructor. More...
 

Detailed Description

Test suite for LIB_SYMBOL.

Definition in file test_lib_part.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/11]

BOOST_AUTO_TEST_CASE ( AddedDrawItems  )

Test adding draw items to a LIB_SYMBOL.

Definition at line 161 of file test_lib_part.cpp.

162{
163}

◆ BOOST_AUTO_TEST_CASE() [2/11]

BOOST_AUTO_TEST_CASE ( AddedFields  )

Test adding fields to a LIB_SYMBOL.

Definition at line 119 of file test_lib_part.cpp.

120{
121 std::vector<LIB_FIELD> fields;
122 m_part_no_data.GetFields( fields );
123
124 // Ctor takes non-const ref (?!)
125 const std::string newFieldName = "new_field";
126 wxString nonConstNewFieldName = newFieldName;
127 fields.push_back( LIB_FIELD( 42, nonConstNewFieldName ) );
128
129 // fairly roundabout way to add a field, but it is what it is
130 m_part_no_data.SetFields( fields );
131
132 // Should get the 4 default fields
133 BOOST_CHECK_PREDICATE( KI_TEST::AreDefaultFieldsCorrect, ( fields ) );
134
135 // and our new one
136 BOOST_REQUIRE_EQUAL( fields.size(), MANDATORY_FIELD_T::MANDATORY_FIELDS + 1 );
137
138 BOOST_CHECK_PREDICATE( KI_TEST::FieldNameIdMatches,
139 ( fields[MANDATORY_FIELD_T::MANDATORY_FIELDS] )( newFieldName )( 42 ) );
140
141 // Check by-id lookup
142
143 LIB_FIELD* gotNewField = m_part_no_data.GetFieldById( 42 );
144
145 BOOST_REQUIRE_NE( gotNewField, nullptr );
146
147 BOOST_CHECK_PREDICATE( KI_TEST::FieldNameIdMatches, ( *gotNewField )( newFieldName )( 42 ) );
148
149 // Check by-name lookup
150
151 gotNewField = m_part_no_data.FindField( newFieldName );
152
153 BOOST_REQUIRE_NE( gotNewField, nullptr );
154 BOOST_CHECK_PREDICATE( KI_TEST::FieldNameIdMatches, ( *gotNewField )( newFieldName )( 42 ) );
155}
Field object used in symbol libraries.
Definition: lib_field.h:60
bool AreDefaultFieldsCorrect(const std::vector< LIB_FIELD > &aFields)
Predicate to check that the mandatory fields in a LIB_FIELDS object look sensible.
bool FieldNameIdMatches(const LIB_FIELD &aField, const std::string &aExpectedName, int aExpectedId)
Predicate to check a field name is as expected.
@ MANDATORY_FIELDS
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.

References KI_TEST::AreDefaultFieldsCorrect(), KI_TEST::FieldNameIdMatches(), and MANDATORY_FIELDS.

◆ BOOST_AUTO_TEST_CASE() [3/11]

BOOST_AUTO_TEST_CASE ( Compare  )

Check the compare method.

Definition at line 222 of file test_lib_part.cpp.

223{
224 // Identical root part to m_part_no_data sans time stamp.
225 LIB_SYMBOL testPart( "part_name" );
226
227 // Self comparison test.
228 BOOST_CHECK_EQUAL( m_part_no_data.Compare( m_part_no_data ), 0 );
229
230 // Test for identical LIB_SYMBOL.
231 BOOST_CHECK_EQUAL( m_part_no_data.Compare( testPart ), 0 );
232
233 // Test name.
234 testPart.SetName( "tart_name" );
235 BOOST_CHECK( m_part_no_data.Compare( testPart ) < 0 );
236 testPart.SetName( "cart_name" );
237 BOOST_CHECK( m_part_no_data.Compare( testPart ) > 0 );
238 testPart.SetName( "part_name" );
239
240 // LIB_ID comparison tests.
241 LIB_ID id = testPart.GetLibId();
242 id.SetLibItemName( "tart_name" );
243 testPart.SetLibId( id );
244 BOOST_CHECK( m_part_no_data.Compare( testPart ) < 0 );
245 id.SetLibItemName( "cart_name" );
246 testPart.SetLibId( id );
247 BOOST_CHECK( m_part_no_data.Compare( testPart ) > 0 );
248 id.SetLibItemName( "part_name" );
249 testPart.SetLibId( id );
250
251 // Unit count comparison tests.
252 testPart.SetUnitCount( 2 );
253 BOOST_CHECK( m_part_no_data.Compare( testPart ) < 0 );
254 testPart.SetUnitCount( 1 );
255 m_part_no_data.SetUnitCount( 2 );
256 BOOST_CHECK( m_part_no_data.Compare( testPart ) > 0 );
257 m_part_no_data.SetUnitCount( 1 );
258
259 // Options flag comparison tests.
260 testPart.SetPower();
261 BOOST_CHECK( m_part_no_data.Compare( testPart ) < 0 );
262 testPart.SetNormal();
263 m_part_no_data.SetPower();
264 BOOST_CHECK( m_part_no_data.Compare( testPart ) > 0 );
265 m_part_no_data.SetNormal();
266
267 // Draw item list size comparison tests.
268 testPart.AddDrawItem( new LIB_SHAPE( &testPart, SHAPE_T::RECT ) );
269 m_part_no_data.AddDrawItem( new LIB_SHAPE( &m_part_no_data, SHAPE_T::RECT ) );
270 BOOST_CHECK_EQUAL( m_part_no_data.Compare( testPart ), 0 );
271 m_part_no_data.RemoveDrawItem( m_part_no_data.GetNextDrawItem( nullptr, LIB_SHAPE_T ) );
272 BOOST_CHECK( m_part_no_data.Compare( testPart ) < 0 );
273 testPart.RemoveDrawItem( testPart.GetNextDrawItem( nullptr, LIB_SHAPE_T ) );
274 m_part_no_data.AddDrawItem( new LIB_SHAPE( &m_part_no_data, SHAPE_T::RECT ) );
275 BOOST_CHECK( m_part_no_data.Compare( testPart ) > 0 );
276 m_part_no_data.RemoveDrawItem( m_part_no_data.GetNextDrawItem( nullptr, LIB_SHAPE_T ) );
277
278 // Draw item list contents comparison tests.
279 testPart.AddDrawItem( new LIB_SHAPE( &testPart, SHAPE_T::RECT ) );
280 m_part_no_data.AddDrawItem( new LIB_SHAPE( &m_part_no_data, SHAPE_T::ARC ) );
281 BOOST_CHECK( m_part_no_data.Compare( testPart ) > 0 );
282 m_part_no_data.RemoveDrawItem( m_part_no_data.GetNextDrawItem( nullptr, LIB_SHAPE_T ) );
283 m_part_no_data.AddDrawItem( new LIB_PIN( &m_part_no_data ) );
284 BOOST_CHECK( m_part_no_data.Compare( testPart ) > 0 );
285 m_part_no_data.RemoveDrawItem( m_part_no_data.GetNextDrawItem( nullptr, LIB_PIN_T ) );
286 testPart.RemoveDrawItem( testPart.GetNextDrawItem( nullptr, LIB_SHAPE_T ) );
287
288 // Footprint filter array comparison tests.
289 wxArrayString footPrintFilters;
290 BOOST_CHECK( m_part_no_data.GetFPFilters() == footPrintFilters );
291 footPrintFilters.Add( "b" );
292 testPart.SetFPFilters( footPrintFilters );
293 BOOST_CHECK( m_part_no_data.Compare( testPart ) < 0 );
294 m_part_no_data.SetFPFilters( footPrintFilters );
295 footPrintFilters.Clear();
296 testPart.SetFPFilters( footPrintFilters );
297 BOOST_CHECK( m_part_no_data.Compare( testPart ) > 0 );
298 footPrintFilters.Clear();
299 m_part_no_data.SetFPFilters( footPrintFilters );
300 testPart.SetFPFilters( footPrintFilters );
301
302 // Description string tests.
303 m_part_no_data.SetDescription( "b" );
304 testPart.SetDescription( "b" );
305 BOOST_CHECK_EQUAL( m_part_no_data.Compare( testPart ), 0 );
306 m_part_no_data.SetDescription( "a" );
307 BOOST_CHECK( m_part_no_data.Compare( testPart ) < 0 );
308 m_part_no_data.SetDescription( "c" );
309 BOOST_CHECK( m_part_no_data.Compare( testPart ) > 0 );
310 m_part_no_data.SetDescription( wxEmptyString );
311 testPart.SetDescription( wxEmptyString );
312
313 // Key word string tests.
314 m_part_no_data.SetKeyWords( "b" );
315 testPart.SetKeyWords( "b" );
316 BOOST_CHECK_EQUAL( m_part_no_data.Compare( testPart ), 0 );
317 m_part_no_data.SetKeyWords( "a" );
318 BOOST_CHECK( m_part_no_data.Compare( testPart ) < 0 );
319 m_part_no_data.SetKeyWords( "c" );
320 BOOST_CHECK( m_part_no_data.Compare( testPart ) > 0 );
321 m_part_no_data.SetKeyWords( wxEmptyString );
322 testPart.SetKeyWords( wxEmptyString );
323
324 // Pin name offset comparison tests.
325 testPart.SetPinNameOffset( testPart.GetPinNameOffset() + 1 );
326 BOOST_CHECK( m_part_no_data.Compare( testPart ) < 0 );
327 testPart.SetPinNameOffset( testPart.GetPinNameOffset() - 2 );
328 BOOST_CHECK( m_part_no_data.Compare( testPart ) > 0 );
329 testPart.SetPinNameOffset( testPart.GetPinNameOffset() + 1 );
330
331 // Units locked flag comparison tests.
332 testPart.LockUnits( true );
333 BOOST_CHECK( m_part_no_data.Compare( testPart ) < 0 );
334 testPart.LockUnits( false );
335 m_part_no_data.LockUnits( true );
336 BOOST_CHECK( m_part_no_data.Compare( testPart ) > 0 );
337 m_part_no_data.LockUnits( false );
338
339 // Include in BOM support tests.
340 testPart.SetIncludeInBom( false );
341 BOOST_CHECK( m_part_no_data.Compare( testPart ) > 0 );
342 testPart.SetIncludeInBom( true );
343 m_part_no_data.SetIncludeInBom( false );
344 BOOST_CHECK( m_part_no_data.Compare( testPart ) < 0 );
345 m_part_no_data.SetIncludeInBom( true );
346
347 // Include on board support tests.
348 testPart.SetIncludeOnBoard( false );
349 BOOST_CHECK( m_part_no_data.Compare( testPart ) > 0 );
350 testPart.SetIncludeOnBoard( true );
351 m_part_no_data.SetIncludeOnBoard( false );
352 BOOST_CHECK( m_part_no_data.Compare( testPart ) < 0 );
353 m_part_no_data.SetIncludeOnBoard( true );
354
355 // Show pin names flag comparison tests.
356 m_part_no_data.SetShowPinNames( false );
357 BOOST_CHECK( m_part_no_data.Compare( testPart ) < 0 );
358 m_part_no_data.SetShowPinNames( true );
359 testPart.SetShowPinNames( false );
360 BOOST_CHECK( m_part_no_data.Compare( testPart ) > 0 );
361 testPart.SetShowPinNames( true );
362
363 // Show pin numbers flag comparison tests.
364 m_part_no_data.SetShowPinNumbers( false );
365 BOOST_CHECK( m_part_no_data.Compare( testPart ) < 0 );
366 m_part_no_data.SetShowPinNumbers( true );
367 testPart.SetShowPinNumbers( false );
368 BOOST_CHECK( m_part_no_data.Compare( testPart ) > 0 );
369 testPart.SetShowPinNumbers( true );
370
371 // Time stamp comparison tests.
372
373 // Check to see if we broke the copy ctor.
374 LIB_SYMBOL* copy = new LIB_SYMBOL( testPart );
375 BOOST_CHECK( testPart.Compare( *copy ) == 0 );
376}
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:52
int SetLibItemName(const UTF8 &aLibItemName)
Override the library item name portion of the LIB_ID to aLibItemName.
Definition: lib_id.cpp:108
Define a library symbol object.
Definition: lib_symbol.h:99
BOOST_CHECK(v2.Cross(v1)==1)
@ LIB_SHAPE_T
Definition: typeinfo.h:191
@ LIB_PIN_T
Definition: typeinfo.h:194

References LIB_SYMBOL::AddDrawItem(), ARC, BOOST_CHECK(), LIB_SYMBOL::Compare(), copy, LIB_SYMBOL::GetLibId(), LIB_SYMBOL::GetNextDrawItem(), LIB_SYMBOL::GetPinNameOffset(), LIB_PIN_T, LIB_SHAPE_T, LIB_SYMBOL::LockUnits(), RECT, LIB_SYMBOL::RemoveDrawItem(), LIB_SYMBOL::SetDescription(), LIB_SYMBOL::SetFPFilters(), LIB_SYMBOL::SetIncludeInBom(), LIB_SYMBOL::SetIncludeOnBoard(), LIB_SYMBOL::SetKeyWords(), LIB_SYMBOL::SetLibId(), LIB_ID::SetLibItemName(), LIB_SYMBOL::SetName(), LIB_SYMBOL::SetNormal(), LIB_SYMBOL::SetPinNameOffset(), LIB_SYMBOL::SetPower(), LIB_SYMBOL::SetShowPinNames(), LIB_SYMBOL::SetShowPinNumbers(), and LIB_SYMBOL::SetUnitCount().

◆ BOOST_AUTO_TEST_CASE() [4/11]

BOOST_AUTO_TEST_CASE ( CopyConstructor  )

Check the copy constructor.

Definition at line 467 of file test_lib_part.cpp.

468{
469 std::shared_ptr<LIB_SYMBOL> copy = std::make_shared<LIB_SYMBOL>( m_part_no_data );
470 BOOST_CHECK( m_part_no_data == *copy.get() );
471}

References BOOST_CHECK(), and copy.

◆ BOOST_AUTO_TEST_CASE() [5/11]

BOOST_AUTO_TEST_CASE ( DefaultDrawings  )

Check the drawings on a "blank" LIB_SYMBOL.

Definition at line 84 of file test_lib_part.cpp.

85{
86 // default drawings exist
87 BOOST_CHECK_EQUAL( m_part_no_data.GetDrawItems().size(), 4 );
88 BOOST_CHECK_EQUAL( m_part_no_data.GetNextDrawItem( nullptr, LIB_PIN_T ), nullptr );
89}

References LIB_PIN_T.

◆ BOOST_AUTO_TEST_CASE() [6/11]

BOOST_AUTO_TEST_CASE ( DefaultFields  )

Check the default fields are present as expected.

Definition at line 95 of file test_lib_part.cpp.

96{
97 std::vector<LIB_FIELD> fields;
98 m_part_no_data.GetFields( fields );
99
100 // Should get the 4 default fields
101 BOOST_CHECK_PREDICATE( KI_TEST::AreDefaultFieldsCorrect, ( fields ) );
102
103 // but no more (we didn't set them)
104 BOOST_CHECK_EQUAL( fields.size(), MANDATORY_FIELD_T::MANDATORY_FIELDS );
105
106 // also check the default field accessors
107 BOOST_CHECK_PREDICATE( KI_TEST::FieldNameIdMatches,
108 ( m_part_no_data.GetReferenceField() )( "Reference" )( MANDATORY_FIELD_T::REFERENCE_FIELD ) );
109 BOOST_CHECK_PREDICATE( KI_TEST::FieldNameIdMatches,
110 ( m_part_no_data.GetValueField() )( "Value" )( MANDATORY_FIELD_T::VALUE_FIELD ) );
111 BOOST_CHECK_PREDICATE( KI_TEST::FieldNameIdMatches,
112 ( m_part_no_data.GetFootprintField() )( "Footprint" )( MANDATORY_FIELD_T::FOOTPRINT_FIELD ) );
113}
@ FOOTPRINT_FIELD
Field Name Module PCB, i.e. "16DIP300".
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".

References KI_TEST::AreDefaultFieldsCorrect(), KI_TEST::FieldNameIdMatches(), FOOTPRINT_FIELD, MANDATORY_FIELDS, REFERENCE_FIELD, and VALUE_FIELD.

◆ BOOST_AUTO_TEST_CASE() [7/11]

BOOST_AUTO_TEST_CASE ( DefaultProperties  )

Declare the test suite.

Check that we can get the basic properties out as expected

Definition at line 59 of file test_lib_part.cpp.

60{
61 BOOST_CHECK_EQUAL( m_part_no_data.GetName(), "part_name" );
62
63 // Didn't set a library, so this is empty
64 BOOST_CHECK_EQUAL( m_part_no_data.GetLibraryName(), "" );
65 BOOST_CHECK_EQUAL( m_part_no_data.GetLib(), nullptr );
66
67 // only get the root
68 BOOST_CHECK_EQUAL( m_part_no_data.IsRoot(), true );
69 BOOST_CHECK_EQUAL( m_part_no_data.IsAlias(), false );
70 BOOST_CHECK_EQUAL( m_part_no_data.SharedPtr().use_count(), 2 );
71
72 // no sub units
73 BOOST_CHECK_EQUAL( m_part_no_data.GetUnitCount(), 1 );
74 BOOST_CHECK_EQUAL( m_part_no_data.IsMulti(), false );
75
76 // no conversion
77 BOOST_CHECK_EQUAL( m_part_no_data.HasConversion(), false );
78}

◆ BOOST_AUTO_TEST_CASE() [8/11]

BOOST_AUTO_TEST_CASE ( GetUnitDrawItems  )

Check the fetch unit draw items code.

Definition at line 424 of file test_lib_part.cpp.

425{
426 // There are no unit draw items in the empty LIB_SYMBOL object.
427 BOOST_CHECK( m_part_no_data.GetUnitDrawItems().size() == 0 );
428
429 // A single unique unit with 1 pin common to all units and all body styles.
430 LIB_PIN* pin1 = new LIB_PIN( &m_part_no_data );
431 pin1->SetNumber( "1" );
432 m_part_no_data.AddDrawItem( pin1 );
433 std::vector<struct LIB_SYMBOL_UNIT> units = m_part_no_data.GetUnitDrawItems();
434 BOOST_CHECK( units.size() == 1 );
435 BOOST_CHECK( units[0].m_unit == 0 );
436 BOOST_CHECK( units[0].m_convert == 0 );
437 BOOST_CHECK( units[0].m_items[0] == pin1 );
438}
void SetNumber(const wxString &aNumber)
Definition: lib_pin.h:125

References BOOST_CHECK(), and LIB_PIN::SetNumber().

◆ BOOST_AUTO_TEST_CASE() [9/11]

BOOST_AUTO_TEST_CASE ( GetUnitItems  )

Check the fetch unit items code.

Definition at line 382 of file test_lib_part.cpp.

383{
384 // There are no unit draw items in the empty LIB_SYMBOL object.
385 BOOST_CHECK( m_part_no_data.GetUnitDrawItems( 1, 1 ).size() == 0 );
386
387 // A single unique unit with 1 pin common to all units and all body styles.
388 LIB_PIN* pin1 = new LIB_PIN( &m_part_no_data );
389 m_part_no_data.AddDrawItem( pin1 );
390 BOOST_CHECK( m_part_no_data.GetUnitDrawItems( 0, 0 ).size() == 1 );
391
392 // A single unique unit with 1 pin in unit 1 and common to all body styles.
393 pin1->SetUnit( 1 );
394 BOOST_CHECK( m_part_no_data.GetUnitDrawItems( 1, 0 ).size() == 1 );
395
396 // A single unique unit with 1 pin in unit 1 and body style 1.
397 pin1->SetConvert( 1 );
398 BOOST_CHECK( m_part_no_data.GetUnitDrawItems( 1, 1 ).size() == 1 );
399
400 // Two unique units with pin 1 assigned to unit 1 and body style 1 and pin 2 assigned to
401 // unit 2 and body style 1.
402 LIB_PIN* pin2 = new LIB_PIN( &m_part_no_data );
403 m_part_no_data.SetUnitCount( 2 );
404 pin2->SetUnit( 2 );
405 pin2->SetConvert( 2 );
406 pin2->SetNumber( "4" );
407 m_part_no_data.AddDrawItem( pin2 );
408 BOOST_CHECK( m_part_no_data.GetUnitDrawItems( 2, 2 ).size() == 1 );
409
410 // Make pin 1 body style common to all units.
411 pin1->SetConvert( 0 );
412 BOOST_CHECK( m_part_no_data.GetUnitDrawItems( 1, 1 ).size() == 0 );
413 BOOST_CHECK( m_part_no_data.GetUnitDrawItems( 2, 1 ).size() == 1 );
414
415 m_part_no_data.RemoveDrawItem( pin2 );
416 m_part_no_data.RemoveDrawItem( pin1 );
417 m_part_no_data.RemoveDrawItem( m_part_no_data.GetNextDrawItem() );
418}
void SetConvert(int aConvert)
Definition: lib_item.h:274
void SetUnit(int aUnit)
Definition: lib_item.h:271

References BOOST_CHECK(), LIB_ITEM::SetConvert(), LIB_PIN::SetNumber(), and LIB_ITEM::SetUnit().

◆ BOOST_AUTO_TEST_CASE() [10/11]

BOOST_AUTO_TEST_CASE ( Inheritance  )

Check inheritance support.

Definition at line 444 of file test_lib_part.cpp.

445{
446 std::unique_ptr<LIB_SYMBOL> parent = std::make_unique<LIB_SYMBOL>( "parent" );
447 BOOST_CHECK( parent->IsRoot() );
448 std::unique_ptr<LIB_SYMBOL> child1 = std::make_unique<LIB_SYMBOL>( "child1", parent.get() );
449 BOOST_CHECK( child1->IsAlias() );
450 LIB_SYMBOL_SPTR parentRef = child1->GetParent().lock();
451 BOOST_CHECK( parentRef );
452 BOOST_CHECK( parentRef == parent->SharedPtr() );
453 BOOST_CHECK_EQUAL( parent->SharedPtr().use_count(), 3 );
454 BOOST_CHECK_EQUAL( child1->GetUnitCount(), 1 );
455 parent->SetUnitCount( 4 );
456 BOOST_CHECK_EQUAL( child1->GetUnitCount(), 4 );
457 child1->SetParent();
458 BOOST_CHECK_EQUAL( child1->GetUnitCount(), 1 );
459 parentRef.reset();
460 BOOST_CHECK_EQUAL( parent->SharedPtr().use_count(), 2 );
461}
std::shared_ptr< LIB_SYMBOL > LIB_SYMBOL_SPTR
shared pointer to LIB_SYMBOL
Definition: lib_symbol.h:45

References BOOST_CHECK().

◆ BOOST_AUTO_TEST_CASE() [11/11]

BOOST_AUTO_TEST_CASE ( SubReference  )

Test the subreference indexing.

Definition at line 177 of file test_lib_part.cpp.

178{
179 const std::vector<TEST_LIB_SYMBOL_SUBREF_CASE> cases = {
180 {
181 1,
182 false,
183 "A",
184 },
185 {
186 2,
187 false,
188 "B",
189 },
190 {
191 26,
192 false,
193 "Z",
194 },
195 {
196 27,
197 false,
198 "AA",
199 },
200 { // haven't configured a separator, so should be nothing
201 1,
202 true,
203 "A",
204 },
205 };
206
207 for( const auto& c : cases )
208 {
210 "Subref: " << c.m_index << ", " << c.m_addSep << " -> '" << c.m_expSubRef << "'" )
211 {
212 const auto subref = m_part_no_data.SubReference( c.m_index, c.m_addSep );
213 BOOST_CHECK_EQUAL( subref, c.m_expSubRef );
214 }
215 }
216}
#define BOOST_TEST_CONTEXT(A)

References BOOST_TEST_CONTEXT.