|
KiCad PCB EDA Suite
|
Regression test: SCH_ITEM::SwapItemData must not change group membership. More...
#include <boost/test/unit_test.hpp>#include <sch_group.h>#include <sch_line.h>#include <sch_screen.h>#include <schematic.h>#include <settings/settings_manager.h>#include <qa_utils/wx_utils/unit_test_utils.h>#include <wx/filename.h>#include <wx/stdpaths.h>#include <memory>Go to the source code of this file.
Classes | |
| struct | SCH_ITEM_SWAP_GROUP_FIXTURE |
Functions | |
| BOOST_AUTO_TEST_CASE (SwapItemDataKeepsGroupMembership) | |
Regression test: SCH_ITEM::SwapItemData must not change group membership.
When a design block (group) move is undone or canceled, each changed item's data is restored with SCH_ITEM::SwapItemData against a saved copy. That copy carries the item's data but no group pointer, so swapping m_group used to null the live item's group, leaving it orphaned from the group that still listed it as a member. The wire then behaved as a loose item and the block could tear apart on a later move.
Group membership is structural and is restored on its own (SCH_GROUP::swapData and the undo group-pointer pass), so a plain data swap must leave it untouched.
Definition in file test_sch_item_swap_group.cpp.
| BOOST_AUTO_TEST_CASE | ( | SwapItemDataKeepsGroupMembership | ) |
Definition at line 85 of file test_sch_item_swap_group.cpp.
References SCH_SCREEN::Append(), BOOST_AUTO_TEST_CASE(), BOOST_REQUIRE(), SCH_LINE::Clone(), SCH_LINE::GetEndPoint(), EDA_ITEM::GetParentGroup(), group, image, LAYER_WIRE, SCH_LINE::SetEndPoint(), and SCH_ITEM::SwapItemData().