25#include <boost/test/data/test_case.hpp>
59 std::unique_ptr<FOOTPRINT>
CreateFootprint(
const std::vector<std::pair<std::string, VECTOR2I>>& padPositions )
61 std::unique_ptr<FOOTPRINT> fp = std::make_unique<FOOTPRINT>(
nullptr );
63 for(
const auto& [number, pos] : padPositions )
66 pad->SetNumber( number );
67 pad->SetFPRelativePosition( pos );
118static const std::vector<std::pair<std::string, VECTOR2I>>
FpDef_NoPins{
124 {
"2", { 0, 1000 } },
125 {
"3", { 2000, 0 } },
126 {
"4", { 2000, 1000 } },
131 {
"1", { -1000, -500 } },
132 {
"2", { -1000, 500 } },
133 {
"3", { 1000, -500 } },
134 {
"4", { 1000, 500 } },
142 {
"2", { 1000, 0 } },
143 {
"3", { 1000, -2000 } },
144 {
"4", { 0, -2000 } },
149 {
"1", { -500, 1000 } },
150 {
"2", { 500, 1000 } },
151 {
"3", { 500, -1000 } },
152 {
"4", { -500, -1000 } },
158 {
"2", { 0, 1000 } },
159 {
"3", { 2000, 0 } },
165 {
"2", { 0, 1000 } },
166 {
"3", { 2000, 0 } },
167 {
"4", { 2100, 1000 } },
173 {
"2", { 0, 1000 } },
174 {
"3", { 2400, 0 } },
175 {
"4", { 2400, 1000 } },
181 {
"2", { 0, 1000 } },
182 {
"3", { 2000, 0 } },
183 {
"4", { 2000, 1000 } },
184 {
"MP", { -1000, 500 } },
185 {
"MP", { 3000, 500 } },
198 "Origin point change",
212 "Rotation and origin point change",
233 "Footprint widened (all pins moved)",
240 "Ignore same named pads",
256 ExecuteTestCase( testCase );
static constexpr EDA_ANGLE ANGLE_0
static constexpr EDA_ANGLE ANGLE_45
static constexpr EDA_ANGLE ANGLE_270
std::optional< EDA_ANGLE > m_ExpectedAngleShift
std::optional< VECTOR2I > m_ExpectedPosShift
friend std::ostream & operator<<(std::ostream &os, const FP_ALIGNMENT_TEST_CASE &testCase)
const std::vector< std::pair< std::string, VECTOR2I > > & m_OrigPadPositions
const std::vector< std::pair< std::string, VECTOR2I > > & m_NewPadPositions
void ExecuteTestCase(const FP_ALIGNMENT_TEST_CASE &testCase)
std::unique_ptr< FOOTPRINT > CreateFootprint(const std::vector< std::pair< std::string, VECTOR2I > > &padPositions)
BOOST_DATA_TEST_CASE(ConvertToKicadUnit, boost::unit_test::data::make(altium_to_kicad_unit), input_value, expected_result)
Test conversation from Altium internal units into KiCad internal units.
BOOST_TEST(contains==c.ExpectedContains)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
VECTOR2< int32_t > VECTOR2I