|
KiCad PCB EDA Suite
|
#include <boost/test/unit_test.hpp>#include <board.h>#include <board_connected_item.h>#include <footprint.h>#include <pad.h>#include <pcb_shape.h>#include <pcb_track.h>#include <zone.h>#include <netinfo.h>#include <pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.h>Go to the source code of this file.
Classes | |
| struct | BOARD_CONNECTED_ITEMS_FIXTURE |
Functions | |
| BOOST_AUTO_TEST_CASE (AllConnectedItems_IncludesFootprintShapes) | |
| Verify that AllConnectedItems includes copper shapes inside footprints. | |
| BOOST_AUTO_TEST_CASE (AllConnectedItems_IncludesFootprintZones) | |
| Verify that AllConnectedItems includes zones inside footprints. | |
| BOOST_AUTO_TEST_CASE (MapNets_RemapsFootprintShapes) | |
| Verify that MapNets remaps net pointers for shapes inside footprints. | |
| BOOST_AUTO_TEST_CASE (MapNets_FootprintShapeSurvivesSourceBoardDeletion) | |
| Verify that after MapNets and source board destruction, pasted items can still be serialized without crashing. | |
| BOOST_AUTO_TEST_CASE | ( | AllConnectedItems_IncludesFootprintShapes | ) |
Verify that AllConnectedItems includes copper shapes inside footprints.
This is a regression test for https://gitlab.com/kicad/code/kicad/-/issues/23093 where footprint-level shapes on copper were missed by AllConnectedItems, causing MapNets to leave dangling NETINFO_ITEM pointers after paste.
Definition at line 53 of file test_board_connected_items.cpp.
References FOOTPRINT::Add(), PADSTACK::ALL_LAYERS, BOOST_AUTO_TEST_CASE(), CIRCLE, F_Cu, FOOTPRINT, PAD, pad, pcbIUScale, SEGMENT, EDA_SHAPE::SetEnd(), PCB_SHAPE::SetLayer(), and EDA_SHAPE::SetStart().
| BOOST_AUTO_TEST_CASE | ( | AllConnectedItems_IncludesFootprintZones | ) |
Verify that AllConnectedItems includes zones inside footprints.
Definition at line 91 of file test_board_connected_items.cpp.
References FOOTPRINT::Add(), ZONE::AppendCorner(), F_Cu, FOOTPRINT, pcbIUScale, and ZONE::SetLayer().
| BOOST_AUTO_TEST_CASE | ( | MapNets_FootprintShapeSurvivesSourceBoardDeletion | ) |
Verify that after MapNets and source board destruction, pasted items can still be serialized without crashing.
This is the exact scenario from issue 23093.
Definition at line 168 of file test_board_connected_items.cpp.
References FOOTPRINT::Add(), PADSTACK::ALL_LAYERS, CIRCLE, F_Cu, FOOTPRINT, PCB_IO_KICAD_SEXPR::Format(), STRING_FORMATTER::GetString(), PAD, pad, pcbIUScale, SEGMENT, EDA_SHAPE::SetEnd(), PCB_SHAPE::SetLayer(), BOARD_CONNECTED_ITEM::SetNet(), PCB_IO_KICAD_SEXPR::SetOutputFormatter(), EDA_ITEM::SetParent(), and EDA_SHAPE::SetStart().
| BOOST_AUTO_TEST_CASE | ( | MapNets_RemapsFootprintShapes | ) |
Verify that MapNets remaps net pointers for shapes inside footprints.
Simulates the paste scenario where items from a clipboard board need their net pointers remapped to the destination board's NETINFO_LIST.
Definition at line 123 of file test_board_connected_items.cpp.
References FOOTPRINT::Add(), PADSTACK::ALL_LAYERS, CIRCLE, F_Cu, FOOTPRINT, BOARD_CONNECTED_ITEM::GetNet(), BOARD_CONNECTED_ITEM::GetNetname(), PAD, pad, pcbIUScale, SEGMENT, EDA_SHAPE::SetEnd(), PCB_SHAPE::SetLayer(), BOARD_CONNECTED_ITEM::SetNet(), and EDA_SHAPE::SetStart().