|
KiCad PCB EDA Suite
|
#include <qa_utils/wx_utils/unit_test_utils.h>#include <base_units.h>#include <board.h>#include <footprint.h>#include <pad.h>#include <pcb_point.h>#include <pcb_shape.h>#include <geometry/eda_angle.h>#include <geometry/shape_line_chain.h>#include <geometry/shape_poly_set.h>#include <pcbnew_utils/board_file_utils.h>#include <filesystem>#include <memory>Go to the source code of this file.
Functions | |
| BOOST_AUTO_TEST_CASE (BezierAndPolyOnTransformedFootprint) | |
| A custom pad's bezier and polygon primitives must survive a save/reload unchanged, even when the parent footprint carries a non-trivial transform (rotated + non-uniform scale). | |
| BOOST_AUTO_TEST_CASE (ScaledFootprintRoundTripStable) | |
| BOOST_AUTO_TEST_CASE (PadPositionAndOrientationRoundTripStable) | |
| BOOST_AUTO_TEST_CASE (PadDeltaRoundTripStable) | |
| BOOST_AUTO_TEST_CASE (PadOffsetRoundTripStable) | |
| BOOST_AUTO_TEST_CASE (FootprintPointRoundTripStable) | |
| BOOST_AUTO_TEST_CASE (RotatedPadSizeRoundTripStable) | |
| BOOST_AUTO_TEST_CASE (PadSizeScalesAlongFootprintAxisRegardlessOfPadOrientation) | |
| BOOST_AUTO_TEST_CASE | ( | BezierAndPolyOnTransformedFootprint | ) |
A custom pad's bezier and polygon primitives must survive a save/reload unchanged, even when the parent footprint carries a non-trivial transform (rotated + non-uniform scale).
Pad primitives are stored in raw library coordinates and are not baked by the footprint transform, so the writer must emit those raw coordinates: applying the footprint transform on save (but reading raw on load) corrupts the round-trip.
Definition at line 113 of file test_custom_pad_primitive_roundtrip.cpp.
References SHAPE_POLY_SET::AddOutline(), PADSTACK::ALL_LAYERS, APPEND, BEZIER, BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), chain, CIRCLE, CUSTOM, DEGREES_T, KI_TEST::DumpBoardToFile(), F_Cu, PCB_SHAPE::GetLibraryBezierC1(), PCB_SHAPE::GetLibraryBezierC2(), PCB_SHAPE::GetLibraryEnd(), PCB_SHAPE::GetLibraryPolyShape(), PCB_SHAPE::GetLibraryStart(), PCB_SHAPE::GetWidth(), SHAPE::GetWidth(), EDA_SHAPE::IsPolyShapeValid(), pad, FOOTPRINT::Pads(), POLY, KI_TEST::ReadBoardFromFileOrStream(), SMD, VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | FootprintPointRoundTripStable | ) |
Definition at line 340 of file test_custom_pad_primitive_roundtrip.cpp.
References APPEND, BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), DEGREES_T, KI_TEST::DumpBoardToFile(), F_Cu, PCB_POINT::GetPosition(), FOOTPRINT::Points(), KI_TEST::ReadBoardFromFileOrStream(), VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | PadDeltaRoundTripStable | ) |
Definition at line 270 of file test_custom_pad_primitive_roundtrip.cpp.
References PADSTACK::ALL_LAYERS, APPEND, BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), KI_TEST::DumpBoardToFile(), F_Cu, PAD::GetDelta(), pad, KI_TEST::ReadBoardFromFileOrStream(), SMD, TRAPEZOID, VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | PadOffsetRoundTripStable | ) |
Definition at line 305 of file test_custom_pad_primitive_roundtrip.cpp.
References PADSTACK::ALL_LAYERS, APPEND, BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), KI_TEST::DumpBoardToFile(), F_Cu, PAD::GetOffset(), pad, KI_TEST::ReadBoardFromFileOrStream(), RECTANGLE, SMD, VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | PadPositionAndOrientationRoundTripStable | ) |
Definition at line 234 of file test_custom_pad_primitive_roundtrip.cpp.
References PADSTACK::ALL_LAYERS, APPEND, EDA_ANGLE::AsDegrees(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), DEGREES_T, KI_TEST::DumpBoardToFile(), F_Cu, PAD::GetOrientation(), PAD::GetPosition(), pad, KI_TEST::ReadBoardFromFileOrStream(), RECTANGLE, SMD, VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | PadSizeScalesAlongFootprintAxisRegardlessOfPadOrientation | ) |
Definition at line 407 of file test_custom_pad_primitive_roundtrip.cpp.
References BOARD::Add(), FOOTPRINT::Add(), PADSTACK::ALL_LAYERS, ANGLE_0, BOOST_CHECK_EQUAL(), DEGREES_T, F_Cu, FOOTPRINT, PAD::GetBoundingBox(), PAD::GetSize(), BOX2< Vec >::GetWidth(), PAD, pad, RECTANGLE, FOOTPRINT::SetOrientation(), FOOTPRINT::SetPosition(), FOOTPRINT::SetTransformScale(), SMD, VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | RotatedPadSizeRoundTripStable | ) |
Definition at line 373 of file test_custom_pad_primitive_roundtrip.cpp.
References PADSTACK::ALL_LAYERS, APPEND, BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), DEGREES_T, KI_TEST::DumpBoardToFile(), F_Cu, PAD::GetSize(), pad, KI_TEST::ReadBoardFromFileOrStream(), RECTANGLE, SMD, VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | ScaledFootprintRoundTripStable | ) |
Definition at line 207 of file test_custom_pad_primitive_roundtrip.cpp.
References PADSTACK::ALL_LAYERS, APPEND, BOOST_REQUIRE(), KI_TEST::DumpBoardToFile(), F_Cu, FOOTPRINT::GetScaleX(), FOOTPRINT::GetScaleY(), pad, KI_TEST::ReadBoardFromFileOrStream(), and SMD.