| 
    KiCad PCB EDA Suite
    
   | 
 
Test suite for ARRAY_OPTIONS. More...
#include <qa_utils/geometry/geometry.h>#include <qa_utils/wx_utils/unit_test_utils.h>#include <base_units.h>#include <trigo.h>#include <array_options.h>Go to the source code of this file.
Classes | |
| struct | GRID_ARRAY_GEOM_PARAMS | 
| Declare the test suite.  More... | |
| struct | GRID_ARRAY_TEST_CASE | 
| struct | CIRC_ARRAY_GEOM_PARAMS | 
| struct | CIRC_ARRAY_TEST_CASE | 
| struct | GRID_ARRAY_NAMING_PARAMS | 
| struct | GRID_ARRAY_NAMING_CASE | 
Functions | |
| std::ostream & | boost_test_print_type (std::ostream &os, const ARRAY_OPTIONS::TRANSFORM &aObj) | 
| Define a stream function for logging this type.   | |
| bool | TransformIsClose (const ARRAY_OPTIONS::TRANSFORM &aL, const ARRAY_OPTIONS::TRANSFORM &aR) | 
| Predicate to see if a ARRAY_OPTIONS::TRANSFORM is equal or nearly equal.   | |
| void | CheckArrayTransforms (const ARRAY_OPTIONS &aOpts, const VECTOR2I &aPos, const std::vector< ARRAY_OPTIONS::TRANSFORM > &aExp) | 
| Generate all array transforms for an array descriptor and compare against a list of expected transforms.   | |
| BOOST_AUTO_TEST_CASE (GridGeometry) | |
| Test of grid array geometry.   | |
| BOOST_AUTO_TEST_CASE (CircularGeometry) | |
| Test of circular array geometry.   | |
| void | CheckArrayNumbering (const ARRAY_OPTIONS &aOpts, const std::vector< std::string > &aExp) | 
| Generate all array names and check against expected.   | |
| BOOST_AUTO_TEST_CASE (GridNaming) | |
| Test of grid array geometry.   | |
Variables | |
| static const std::vector< GRID_ARRAY_TEST_CASE > | grid_geom_cases | 
| static const std::vector< CIRC_ARRAY_TEST_CASE > | circ_geom_cases | 
| static const std::vector< GRID_ARRAY_NAMING_CASE > | grid_name_cases | 
Test suite for ARRAY_OPTIONS.
Definition in file test_array_options.cpp.
| BOOST_AUTO_TEST_CASE | ( | CircularGeometry | ) | 
Test of circular array geometry.
Definition at line 356 of file test_array_options.cpp.
References BOOST_TEST_CONTEXT(), CheckArrayTransforms(), circ_geom_cases, DEGREES_T, ARRAY_CIRCULAR_OPTIONS::m_angle, ARRAY_CIRCULAR_OPTIONS::m_centre, ARRAY_CIRCULAR_OPTIONS::m_nPts, and ARRAY_CIRCULAR_OPTIONS::m_rotateItems.
| BOOST_AUTO_TEST_CASE | ( | GridGeometry | ) | 
Test of grid array geometry.
Definition at line 259 of file test_array_options.cpp.
References BOOST_TEST_CONTEXT(), CheckArrayTransforms(), grid_geom_cases, ARRAY_GRID_OPTIONS::m_delta, ARRAY_GRID_OPTIONS::m_horizontalThenVertical, ARRAY_GRID_OPTIONS::m_nx, ARRAY_GRID_OPTIONS::m_ny, ARRAY_GRID_OPTIONS::m_offset, ARRAY_GRID_OPTIONS::m_reverseNumberingAlternate, ARRAY_GRID_OPTIONS::m_stagger, and ARRAY_GRID_OPTIONS::m_stagger_rows.
| BOOST_AUTO_TEST_CASE | ( | GridNaming | ) | 
Test of grid array geometry.
Definition at line 483 of file test_array_options.cpp.
References BOOST_TEST_CONTEXT(), CheckArrayNumbering(), grid_name_cases, ARRAY_GRID_OPTIONS::m_2dArrayNumbering, ARRAY_GRID_OPTIONS::m_horizontalThenVertical, ARRAY_GRID_OPTIONS::m_nx, ARRAY_GRID_OPTIONS::m_ny, ARRAY_GRID_OPTIONS::m_pri_axis, ARRAY_GRID_OPTIONS::m_sec_axis, ARRAY_AXIS::SetAxisType(), and ARRAY_AXIS::SetOffset().
| std::ostream & boost_test_print_type | ( | std::ostream & | os, | 
| const ARRAY_OPTIONS::TRANSFORM & | aObj ) | 
Define a stream function for logging this type.
Definition at line 40 of file test_array_options.cpp.
References EDA_ANGLE::AsDegrees(), ARRAY_OPTIONS::TRANSFORM::m_offset, and ARRAY_OPTIONS::TRANSFORM::m_rotation.
| void CheckArrayNumbering | ( | const ARRAY_OPTIONS & | aOpts, | 
| const std::vector< std::string > & | aExp ) | 
Generate all array names and check against expected.
| aOpts | the array descriptor | 
| aExp | expected name list | 
Definition at line 379 of file test_array_options.cpp.
References ARRAY_OPTIONS::GetArraySize(), and ARRAY_OPTIONS::GetItemNumber().
Referenced by BOOST_AUTO_TEST_CASE().
| void CheckArrayTransforms | ( | const ARRAY_OPTIONS & | aOpts, | 
| const VECTOR2I & | aPos, | ||
| const std::vector< ARRAY_OPTIONS::TRANSFORM > & | aExp ) | 
Generate all array transforms for an array descriptor and compare against a list of expected transforms.
| aOpts | the array descriptor | 
| aPos | the position of the reference item | 
| aExp | expected transform list | 
Definition at line 66 of file test_array_options.cpp.
References BOOST_CHECK_EQUAL(), BOOST_CHECK_PREDICATE(), BOOST_TEST_CONTEXT(), ARRAY_OPTIONS::GetArraySize(), ARRAY_OPTIONS::GetTransform(), and TransformIsClose().
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
| bool TransformIsClose | ( | const ARRAY_OPTIONS::TRANSFORM & | aL, | 
| const ARRAY_OPTIONS::TRANSFORM & | aR ) | 
Predicate to see if a ARRAY_OPTIONS::TRANSFORM is equal or nearly equal.
Definition at line 51 of file test_array_options.cpp.
References EDA_ANGLE::AsDegrees(), KI_TEST::IsVecWithinTol(), KI_TEST::IsWithin(), ARRAY_OPTIONS::TRANSFORM::m_offset, and ARRAY_OPTIONS::TRANSFORM::m_rotation.
Referenced by CheckArrayTransforms().
      
  | 
  static | 
Definition at line 300 of file test_array_options.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
      
  | 
  static | 
Definition at line 116 of file test_array_options.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
      
  | 
  static | 
Definition at line 414 of file test_array_options.cpp.
Referenced by BOOST_AUTO_TEST_CASE().