KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_sch_item_swap_group.cpp File Reference

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)
 

Detailed Description

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.

Function Documentation

◆ BOOST_AUTO_TEST_CASE()