KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_footprint_courtyard_chaining.cpp File Reference
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <board.h>
#include <footprint.h>
#include <pcb_shape.h>
#include <base_units.h>
#include <numeric>
#include <random>

Go to the source code of this file.

Classes

struct  COURTYARD_SEGMENT
 
struct  COURTYARD_ARC
 

Functions

static VECTOR2I mmPoint (double aX, double aY)
 
static void buildShapes (FOOTPRINT &aFootprint, const std::vector< COURTYARD_SEGMENT > &aSegments, const std::vector< COURTYARD_ARC > &aArcs, const std::vector< size_t > &aOrder)
 
static void checkCourtyardCloses (const std::vector< COURTYARD_SEGMENT > &aSegments, const std::vector< COURTYARD_ARC > &aArcs, const std::vector< size_t > &aOrder)
 
 BOOST_AUTO_TEST_CASE (ClosesFromEverySeedShape)
 The courtyard closes whatever order its shapes arrive in.
 
 BOOST_AUTO_TEST_CASE (ClosesInArbitraryShapeOrder)
 

Variables

static const std::vector< COURTYARD_SEGMENTl5Segments
 
static const std::vector< COURTYARD_ARCl5Arcs
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/2]

BOOST_AUTO_TEST_CASE ( ClosesFromEverySeedShape )

The courtyard closes whatever order its shapes arrive in.

Shape order used to track allocation addresses, so ticket 2491 saw the error come and go.

Definition at line 142 of file test_footprint_courtyard_chaining.cpp.

References BOOST_TEST_CONTEXT(), checkCourtyardCloses(), l5Arcs, and l5Segments.

◆ BOOST_AUTO_TEST_CASE() [2/2]

BOOST_AUTO_TEST_CASE ( ClosesInArbitraryShapeOrder )

◆ buildShapes()

static void buildShapes ( FOOTPRINT & aFootprint,
const std::vector< COURTYARD_SEGMENT > & aSegments,
const std::vector< COURTYARD_ARC > & aArcs,
const std::vector< size_t > & aOrder )
static

◆ checkCourtyardCloses()

static void checkCourtyardCloses ( const std::vector< COURTYARD_SEGMENT > & aSegments,
const std::vector< COURTYARD_ARC > & aArcs,
const std::vector< size_t > & aOrder )
static

◆ mmPoint()

static VECTOR2I mmPoint ( double aX,
double aY )
static

Definition at line 86 of file test_footprint_courtyard_chaining.cpp.

References pcbIUScale.

Referenced by buildShapes().

Variable Documentation

◆ l5Arcs

const std::vector<COURTYARD_ARC> l5Arcs
static
Initial value:
= {
{ -6.025000, -1.500000, -5.880489, -1.942586, -5.502647, -2.214616 },
{ -5.502647, 2.214616, -5.880490, 1.942586, -6.025000, 1.500000 },
{ -5.500000, -5.250000, -5.426777, -5.426777, -5.250000, -5.500000 },
{ -5.250000, 5.500000, -5.426777, 5.426777, -5.500000, 5.250000 },
{ 5.250000, -5.500000, 5.426777, -5.426777, 5.500000, -5.250000 },
{ 5.500000, 5.250000, 5.426777, 5.426777, 5.250000, 5.500000 },
{ 5.502647, -2.214616, 5.880489, -1.942586, 6.025000, -1.500000 },
{ 6.025000, 1.500000, 5.880490, 1.942586, 5.502647, 2.214616 },
}

Definition at line 74 of file test_footprint_courtyard_chaining.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ l5Segments

const std::vector<COURTYARD_SEGMENT> l5Segments
static
Initial value:
= {
{ -6.025, -1.500000, -6.025, 1.500000 },
{ -5.502647, -2.214616, -5.500000, -2.225000 },
{ -5.502647, 2.214616, -5.500000, 2.225000 },
{ -5.500000, -5.250000, -5.500000, -2.225000 },
{ -5.500000, 5.250000, -5.500000, 2.225000 },
{ -5.250000, -5.500000, 5.250000, -5.500000 },
{ -5.250000, 5.500000, 5.250000, 5.500000 },
{ 5.500000, -5.250000, 5.500000, -2.221321 },
{ 5.500000, -2.221321, 5.502647, -2.214616 },
{ 5.500000, 5.250000, 5.500000, 2.225000 },
{ 5.502647, 2.214616, 5.500000, 2.225000 },
{ 6.025, 1.500000, 6.025, -1.500000 },
}

Definition at line 58 of file test_footprint_courtyard_chaining.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().