KiCad PCB EDA Suite
test_lib_part.cpp File Reference

Test suite for LIB_PART. More...

#include <unit_test_utils/unit_test_utils.h>
#include <lib_rectangle.h>
#include <lib_arc.h>
#include <lib_pin.h>
#include "lib_field_test_utils.h"

Go to the source code of this file.

Classes

class  TEST_LIB_PART_FIXTURE
 
struct  TEST_LIB_PART_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_PART. 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_PART. More...
 
 BOOST_AUTO_TEST_CASE (AddedDrawItems)
 Test adding draw items to a LIB_PART. 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_PART.

Definition in file test_lib_part.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/11]

BOOST_AUTO_TEST_CASE ( DefaultProperties  )

Declare the test suite.

Check that we can get the basic properties out as expected

Definition at line 60 of file test_lib_part.cpp.

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

◆ BOOST_AUTO_TEST_CASE() [2/11]

BOOST_AUTO_TEST_CASE ( DefaultDrawings  )

Check the drawings on a "blank" LIB_PART.

Definition at line 85 of file test_lib_part.cpp.

86 {
87  // default drawings exist
88  BOOST_CHECK_EQUAL( m_part_no_data.GetDrawItems().size(), 4 );
89  BOOST_CHECK_EQUAL( m_part_no_data.GetNextDrawItem( NULL, LIB_PIN_T ), (LIB_ITEM*)NULL );
90 }
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
#define NULL

References LIB_PIN_T, and NULL.

◆ BOOST_AUTO_TEST_CASE() [3/11]

BOOST_AUTO_TEST_CASE ( DefaultFields  )

Check the default fields are present as expected.

Definition at line 96 of file test_lib_part.cpp.

97 {
98  std::vector<LIB_FIELD> fields;
99  m_part_no_data.GetFields( fields );
100 
101  // Should get the 4 default fields
102  BOOST_CHECK_PREDICATE( KI_TEST::AreDefaultFieldsCorrect, ( fields ) );
103 
104  // but no more (we didn't set them)
105  BOOST_CHECK_EQUAL( fields.size(), MANDATORY_FIELD_T::MANDATORY_FIELDS );
106 
107  // also check the default field accessors
108  BOOST_CHECK_PREDICATE( KI_TEST::FieldNameIdMatches,
109  ( m_part_no_data.GetReferenceField() )( "Reference" )( MANDATORY_FIELD_T::REFERENCE_FIELD ) );
110  BOOST_CHECK_PREDICATE( KI_TEST::FieldNameIdMatches,
111  ( m_part_no_data.GetValueField() )( "Value" )( MANDATORY_FIELD_T::VALUE_FIELD ) );
112  BOOST_CHECK_PREDICATE( KI_TEST::FieldNameIdMatches,
113  ( m_part_no_data.GetFootprintField() )( "Footprint" )( MANDATORY_FIELD_T::FOOTPRINT_FIELD ) );
114 }
Field Reference of part, i.e. "IC21".
bool AreDefaultFieldsCorrect(const std::vector< LIB_FIELD > &aFields)
Predicate to check that the mandatory fields in a LIB_FIELDS object look sensible.
Field Value of part, i.e. "3.3K".
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
bool FieldNameIdMatches(const LIB_FIELD &aField, const std::string &aExpectedName, int aExpectedId)
Predicate to check a field name is as expected.
Field Name Module PCB, i.e. "16DIP300".

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

◆ BOOST_AUTO_TEST_CASE() [4/11]

BOOST_AUTO_TEST_CASE ( AddedFields  )

Test adding fields to a LIB_PART.

Definition at line 120 of file test_lib_part.cpp.

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

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

◆ BOOST_AUTO_TEST_CASE() [5/11]

BOOST_AUTO_TEST_CASE ( AddedDrawItems  )

Test adding draw items to a LIB_PART.

Definition at line 162 of file test_lib_part.cpp.

163 {
164 }

◆ BOOST_AUTO_TEST_CASE() [6/11]

BOOST_AUTO_TEST_CASE ( SubReference  )

Test the subreference indexing.

Definition at line 178 of file test_lib_part.cpp.

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

References BOOST_TEST_CONTEXT.

◆ BOOST_AUTO_TEST_CASE() [7/11]

BOOST_AUTO_TEST_CASE ( Compare  )

Check the compare method.

Definition at line 223 of file test_lib_part.cpp.

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

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

◆ BOOST_AUTO_TEST_CASE() [8/11]

BOOST_AUTO_TEST_CASE ( GetUnitItems  )

Check the fetch unit items code.

Definition at line 383 of file test_lib_part.cpp.

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

References BOOST_CHECK().

◆ BOOST_AUTO_TEST_CASE() [9/11]

BOOST_AUTO_TEST_CASE ( GetUnitDrawItems  )

Check the fetch unit draw items code.

Definition at line 425 of file test_lib_part.cpp.

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

References BOOST_CHECK().

◆ BOOST_AUTO_TEST_CASE() [10/11]

BOOST_AUTO_TEST_CASE ( Inheritance  )

Check inheritance support.

Definition at line 445 of file test_lib_part.cpp.

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

References BOOST_CHECK().

◆ BOOST_AUTO_TEST_CASE() [11/11]

BOOST_AUTO_TEST_CASE ( CopyConstructor  )

Check the copy constructor.

Definition at line 468 of file test_lib_part.cpp.

469 {
470  std::shared_ptr<LIB_PART> copy = std::make_shared<LIB_PART>( m_part_no_data );
471  BOOST_CHECK( m_part_no_data == *copy.get() );
472 }
BOOST_CHECK(v2.Cross(v1)==1)

References BOOST_CHECK(), and copy.