|
KiCad PCB EDA Suite
|
Regression tests for clipboard copy/paste round trips. More...
#include <qa_utils/wx_utils/unit_test_utils.h>#include <board.h>#include <footprint.h>#include <kicad_clipboard.h>#include <lset.h>#include <pad.h>#include <pcb_group.h>#include <pcb_shape.h>#include <tools/pcb_selection.h>Go to the source code of this file.
Functions | |
| BOOST_AUTO_TEST_CASE (CopyPasteGroupPreservesMembership) | |
| Copy a group containing two PCB_SHAPE objects to the clipboard, parse it back, and verify the round-tripped board still contains the group with both members associated. | |
| BOOST_AUTO_TEST_CASE (CopyPasteNestedGroupPreservesMembership) | |
| Copy a nested group structure (group containing a group) and verify both levels survive the clipboard round-trip with intact membership. | |
| BOOST_AUTO_TEST_CASE (CopyPasteLoneFootprintKeepsBody) | |
| A lone footprint used to go to the clipboard as a bare (footprint ...), which is an object and not a document, so the payload carried no header for the parser to read it against. | |
Regression tests for clipboard copy/paste round trips.
The group cases guard against https://gitlab.com/kicad/code/kicad/-/issues/24000 where groups appeared ungrouped after paste because PCB_IO_KICAD_SEXPR::format(PCB_GROUP*) validated cloned member pointers against the source board's pointer cache and dropped every member as "invalid", causing the (group ...) sexpr to be omitted entirely.
Definition in file test_clipboard_group.cpp.
| BOOST_AUTO_TEST_CASE | ( | CopyPasteGroupPreservesMembership | ) |
Copy a group containing two PCB_SHAPE objects to the clipboard, parse it back, and verify the round-tripped board still contains the group with both members associated.
Definition at line 78 of file test_clipboard_group.cpp.
References SELECTION::Add(), LSET::AllCuMask(), LSET::AllTechMask(), BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_REQUIRE_EQUAL(), F_SilkS, EDA_GROUP::GetItems(), EDA_GROUP::GetName(), EDA_ITEM::GetParentGroup(), group, pcbIUScale, rect(), RECTANGLE, SEGMENT, PCB_SHAPE::SetEnd(), PCB_SHAPE::SetLayer(), PCB_SHAPE::SetStart(), PCB_SHAPE::SetStroke(), and SOLID.
| BOOST_AUTO_TEST_CASE | ( | CopyPasteLoneFootprintKeepsBody | ) |
A lone footprint used to go to the clipboard as a bare (footprint ...), which is an object and not a document, so the payload carried no header for the parser to read it against.
Definition at line 205 of file test_clipboard_group.cpp.
References SELECTION::Add(), PADSTACK::ALL_LAYERS, LSET::AllCuMask(), LSET::AllTechMask(), BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE_EQUAL(), F_Cu, F_Mask, F_Paste, F_SilkS, FOOTPRINT, FOOTPRINT::GraphicalItems(), PAD, pad, FOOTPRINT::Pads(), pcbIUScale, SEGMENT, PCB_SHAPE::SetEnd(), PCB_SHAPE::SetLayer(), PCB_SHAPE::SetStart(), PCB_SHAPE::SetStroke(), SMD, SOLID, and source.
| BOOST_AUTO_TEST_CASE | ( | CopyPasteNestedGroupPreservesMembership | ) |
Copy a nested group structure (group containing a group) and verify both levels survive the clipboard round-trip with intact membership.
Definition at line 129 of file test_clipboard_group.cpp.
References SELECTION::Add(), EDA_GROUP::AddItem(), LSET::AllCuMask(), LSET::AllTechMask(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_REQUIRE_EQUAL(), F_SilkS, EDA_GROUP::GetItems(), EDA_ITEM::GetParentGroup(), pcbIUScale, SEGMENT, PCB_SHAPE::SetEnd(), PCB_SHAPE::SetLayer(), EDA_GROUP::SetName(), PCB_SHAPE::SetStart(), PCB_SHAPE::SetStroke(), and SOLID.