|
KiCad PCB EDA Suite
|
Test for issue #24335: Moving of grouped components breaks wire positions. More...
#include <boost/test/unit_test.hpp>#include <eda_item.h>#include <sch_field.h>#include <sch_group.h>#include <sch_line.h>#include <sch_screen.h>#include <sch_symbol.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>Go to the source code of this file.
Classes | |
| struct | GROUP_MOVE_ANCESTOR_FIXTURE |
Functions | |
| BOOST_AUTO_TEST_CASE (SymbolInsideSelectedGroupReportsAncestor) | |
| BOOST_AUTO_TEST_CASE (NestedGroupAncestorIsDetected) | |
| BOOST_AUTO_TEST_CASE (SymbolFieldInheritsAncestorGroupViaParent) | |
| BOOST_AUTO_TEST_CASE (WireInsideSelectedGroupReportsAncestor) | |
Test for issue #24335: Moving of grouped components breaks wire positions.
Root cause: getConnectedDragItems() in sch_move_tool.cpp used a plain IsSelected() check on candidate items to decide whether to skip them. Items that move as members of a selected group do not carry the SELECTED flag themselves, so they were treated as fixed anchors. When an outside wire endpoint touched a symbol pin belonging to such a group member, a spurious stub wire was synthesised at the group boundary, producing the broken diagonal wires observed in the report.
The fix introduces EDA_ITEM::HasSelectedAncestorGroup() which walks the parent-group chain and returns true if any ancestor group is selected. This test exercises that helper for the scenarios used inside getConnectedDragItems.
Definition in file test_issue24335_group_move_ancestor.cpp.
| BOOST_AUTO_TEST_CASE | ( | NestedGroupAncestorIsDetected | ) |
Definition at line 120 of file test_issue24335_group_move_ancestor.cpp.
References EDA_GROUP::AddItem(), SCH_SCREEN::Append(), BOOST_REQUIRE(), EDA_ITEM::ClearSelected(), EDA_ITEM::GetParentGroup(), EDA_ITEM::HasSelectedAncestorGroup(), SCH_SYMBOL::SetPosition(), and EDA_ITEM::SetSelected().
| BOOST_AUTO_TEST_CASE | ( | SymbolFieldInheritsAncestorGroupViaParent | ) |
Definition at line 152 of file test_issue24335_group_move_ancestor.cpp.
References SCH_SCREEN::Append(), BOOST_REQUIRE(), SCH_SYMBOL::GetField(), EDA_ITEM::GetParent(), EDA_ITEM::GetParentGroup(), group, EDA_ITEM::HasSelectedAncestorGroup(), REFERENCE, and SCH_SYMBOL::SetPosition().
| BOOST_AUTO_TEST_CASE | ( | SymbolInsideSelectedGroupReportsAncestor | ) |
Definition at line 90 of file test_issue24335_group_move_ancestor.cpp.
References SCH_SCREEN::Append(), BOOST_AUTO_TEST_CASE(), BOOST_REQUIRE(), group, EDA_ITEM::HasSelectedAncestorGroup(), EDA_ITEM::IsSelected(), and SCH_SYMBOL::SetPosition().
| BOOST_AUTO_TEST_CASE | ( | WireInsideSelectedGroupReportsAncestor | ) |
Definition at line 178 of file test_issue24335_group_move_ancestor.cpp.
References SCH_SCREEN::Append(), BOOST_REQUIRE(), group, EDA_ITEM::HasSelectedAncestorGroup(), LAYER_WIRE, and SCH_LINE::SetEndPoint().