KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_footprint_realignment.cpp File Reference
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <boost/test/data/test_case.hpp>
#include <optional>
#include <ostream>
#include <string>
#include <utility>
#include <vector>
#include <footprint_utils.h>
#include <board.h>
#include <footprint.h>
#include <pad.h>

Go to the source code of this file.

Classes

struct  ALIGN_FP_DEF
 Information needed to make a footprint to use for alignment tests. More...
 
struct  FP_ALIGNMENT_TEST_CASE
 
struct  FP_REALIGNMENT_TEST_FIXTURE
 
struct  SELF_ALIGNMENT_TEST_CASE
 Definition of a test case for self-to-self alignment. More...
 

Functions

std::ostream & operator<< (std::ostream &os, const ALIGN_FP_DEF &fpDef)
 
std::ostream & operator<< (std::ostream &os, const SELF_ALIGNMENT_TEST_CASE &testCase)
 
 BOOST_DATA_TEST_CASE (TestSelfToSelfCases, boost::unit_test::data::make(FpSelfToSelfCases), selfCase)
 
 BOOST_DATA_TEST_CASE (TestAllCases, boost::unit_test::data::make(FpAlignmentTestCases), testCase)
 

Variables

static const ALIGN_FP_DEF FpDef_NoPins
 
static const ALIGN_FP_DEF FpDef_DIP4_OrigPin1
 
static const ALIGN_FP_DEF FpDef_DIP4_OrigBodyCenter
 
static const ALIGN_FP_DEF FpDef_DIP4_Rotated90DegCCW
 
static const ALIGN_FP_DEF FpDef_DIP4_OrigBodyCenter_Rotated90DegCCW
 
static const ALIGN_FP_DEF FpDef_DIP4_Pin4Deleted
 
static const ALIGN_FP_DEF FpDef_DIP4_Pin4Moved
 
static const ALIGN_FP_DEF FpDef_DIP4_Widened
 
static const ALIGN_FP_DEF FpDef_DIP4_WithMPs
 
static const std::vector< SELF_ALIGNMENT_TEST_CASEFpSelfToSelfCases
 
static const std::vector< FP_ALIGNMENT_TEST_CASEFpAlignmentTestCases
 

Function Documentation

◆ BOOST_DATA_TEST_CASE() [1/2]

BOOST_DATA_TEST_CASE ( TestAllCases ,
boost::unit_test::data::make(FpAlignmentTestCases) ,
testCase  )

Definition at line 367 of file test_footprint_realignment.cpp.

References FpAlignmentTestCases.

◆ BOOST_DATA_TEST_CASE() [2/2]

BOOST_DATA_TEST_CASE ( TestSelfToSelfCases ,
boost::unit_test::data::make(FpSelfToSelfCases) ,
selfCase  )

◆ operator<<() [1/2]

std::ostream & operator<< ( std::ostream & os,
const ALIGN_FP_DEF & fpDef )

Definition at line 46 of file test_footprint_realignment.cpp.

References ALIGN_FP_DEF::m_name.

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream & os,
const SELF_ALIGNMENT_TEST_CASE & testCase )

Variable Documentation

◆ FpAlignmentTestCases

const std::vector<FP_ALIGNMENT_TEST_CASE> FpAlignmentTestCases
static

Definition at line 268 of file test_footprint_realignment.cpp.

Referenced by BOOST_DATA_TEST_CASE().

◆ FpDef_DIP4_OrigBodyCenter

const ALIGN_FP_DEF FpDef_DIP4_OrigBodyCenter
static
Initial value:
{
"DIP4, body center at origin",
{
{ "1", { -1000, -500 } },
{ "2", { -1000, 500 } },
{ "3", { 1000, -500 } },
{ "4", { 1000, 500 } },
},
}

Definition at line 155 of file test_footprint_realignment.cpp.

◆ FpDef_DIP4_OrigBodyCenter_Rotated90DegCCW

const ALIGN_FP_DEF FpDef_DIP4_OrigBodyCenter_Rotated90DegCCW
static
Initial value:
{
"DIP4, body center at origin, rotated 90 deg CCW",
{
{ "1", { -500, 1000 } },
{ "2", { 500, 1000 } },
{ "3", { 500, -1000 } },
{ "4", { -500, -1000 } },
},
}

Definition at line 179 of file test_footprint_realignment.cpp.

◆ FpDef_DIP4_OrigPin1

const ALIGN_FP_DEF FpDef_DIP4_OrigPin1
static
Initial value:
{
"DIP4, pin 1 at origin",
{
{ "1", { 0, 0 } },
{ "2", { 0, 1000 } },
{ "3", { 2000, 0 } },
{ "4", { 2000, 1000 } },
},
}

Definition at line 144 of file test_footprint_realignment.cpp.

◆ FpDef_DIP4_Pin4Deleted

const ALIGN_FP_DEF FpDef_DIP4_Pin4Deleted
static
Initial value:
{
"DIP4, pin 4 deleted",
{
{ "1", { 0, 0 } },
{ "2", { 0, 1000 } },
{ "3", { 2000, 0 } },
},
}

Definition at line 190 of file test_footprint_realignment.cpp.

◆ FpDef_DIP4_Pin4Moved

const ALIGN_FP_DEF FpDef_DIP4_Pin4Moved
static
Initial value:
{
"DIP4, pin 4 moved",
{
{ "1", { 0, 0 } },
{ "2", { 0, 1000 } },
{ "3", { 2000, 0 } },
{ "4", { 2100, 1000 } },
},
}

Definition at line 200 of file test_footprint_realignment.cpp.

◆ FpDef_DIP4_Rotated90DegCCW

const ALIGN_FP_DEF FpDef_DIP4_Rotated90DegCCW
static
Initial value:
{
"DIP4, rotated 90 deg CCW",
{
{ "1", { 0, 0 } },
{ "2", { 1000, 0 } },
{ "3", { 1000, -2000 } },
{ "4", { 0, -2000 } },
},
}

Definition at line 168 of file test_footprint_realignment.cpp.

◆ FpDef_DIP4_Widened

const ALIGN_FP_DEF FpDef_DIP4_Widened
static
Initial value:
{
"DIP4, widened",
{
{ "1", { 0, 0 } },
{ "2", { 0, 1000 } },
{ "3", { 2400, 0 } },
{ "4", { 2400, 1000 } },
},
}

Definition at line 211 of file test_footprint_realignment.cpp.

◆ FpDef_DIP4_WithMPs

const ALIGN_FP_DEF FpDef_DIP4_WithMPs
static
Initial value:
{
"DIP4, with mechanical pins",
{
{ "1", { 0, 0 } },
{ "2", { 0, 1000 } },
{ "3", { 2000, 0 } },
{ "4", { 2000, 1000 } },
{ "MP", { -1000, 500 } },
{ "MP", { 3000, 500 } },
},
}

Definition at line 222 of file test_footprint_realignment.cpp.

◆ FpDef_NoPins

const ALIGN_FP_DEF FpDef_NoPins
static
Initial value:
{
"No pins",
{},
}

Definition at line 138 of file test_footprint_realignment.cpp.

◆ FpSelfToSelfCases

const std::vector<SELF_ALIGNMENT_TEST_CASE> FpSelfToSelfCases
static
Initial value:
= {
{ FpDef_NoPins, false },
{ FpDef_DIP4_Widened, true },
{ FpDef_DIP4_WithMPs, true },
}
static const ALIGN_FP_DEF FpDef_DIP4_OrigBodyCenter
static const ALIGN_FP_DEF FpDef_DIP4_Rotated90DegCCW
static const ALIGN_FP_DEF FpDef_DIP4_OrigPin1
static const ALIGN_FP_DEF FpDef_DIP4_WithMPs
static const ALIGN_FP_DEF FpDef_DIP4_Pin4Deleted
static const ALIGN_FP_DEF FpDef_NoPins
static const ALIGN_FP_DEF FpDef_DIP4_Widened
static const ALIGN_FP_DEF FpDef_DIP4_OrigBodyCenter_Rotated90DegCCW
static const ALIGN_FP_DEF FpDef_DIP4_Pin4Moved

Definition at line 247 of file test_footprint_realignment.cpp.

Referenced by BOOST_DATA_TEST_CASE().