|
KiCad PCB EDA Suite
|
Test for issue #22864: "Align Items to Grid" disconnects wires from hierarchical sheet pins. More...
#include <qa_utils/wx_utils/unit_test_utils.h>#include <schematic_utils/schematic_file_util.h>#include <schematic.h>#include <sch_sheet.h>#include <sch_sheet_path.h>#include <sch_sheet_pin.h>#include <sch_screen.h>#include <sch_line.h>#include <settings/settings_manager.h>#include <locale_io.h>#include <base_units.h>#include <sch_item_alignment.h>#include <tools/ee_grid_helper.h>Go to the source code of this file.
Classes | |
| class | TEST_GRID_HELPER |
| Helper class to test grid alignment with configurable grid size. More... | |
| struct | ISSUE22864_FIXTURE |
Functions | |
| BOOST_FIXTURE_TEST_CASE (AlignAllItemsStandardGrid, ISSUE22864_FIXTURE) | |
| Test aligning all items with standard grid (2.54mm). | |
| BOOST_FIXTURE_TEST_CASE (AlignAllItemsFineGrid, ISSUE22864_FIXTURE) | |
| Test aligning all items with fine grid (1.27mm). | |
| BOOST_FIXTURE_TEST_CASE (AlignAllItemsCoarseGrid, ISSUE22864_FIXTURE) | |
| Test aligning all items with coarse grid (5.08mm). | |
| BOOST_FIXTURE_TEST_CASE (AlignSheet1Only, ISSUE22864_FIXTURE) | |
| Test aligning only sheet1 with standard grid. | |
| BOOST_FIXTURE_TEST_CASE (AlignSheet2Only, ISSUE22864_FIXTURE) | |
| Test aligning only sheet2 with standard grid. | |
| BOOST_FIXTURE_TEST_CASE (AlignSheet1ThenSheet2, ISSUE22864_FIXTURE) | |
| Test aligning sheet1 then sheet2 sequentially. | |
| BOOST_FIXTURE_TEST_CASE (AlignSheet2ThenSheet1, ISSUE22864_FIXTURE) | |
| Test aligning sheet2 then sheet1 sequentially. | |
| BOOST_FIXTURE_TEST_CASE (AlignMultipleGridSizes, ISSUE22864_FIXTURE) | |
| Test aligning with multiple different grid sizes in sequence. | |
| BOOST_FIXTURE_TEST_CASE (VerifyPinWireYCoordinateMatch, ISSUE22864_FIXTURE) | |
| Test that aligning sheets preserves pin-to-wire Y coordinate match. | |
| BOOST_FIXTURE_TEST_CASE (AlignSheetsAndWiresTogether, ISSUE22864_FIXTURE) | |
| Test aligning when both sheets AND wires are selected together. | |
| BOOST_FIXTURE_TEST_CASE (AlignSheetsAndWiresMultipleGrids, ISSUE22864_FIXTURE) | |
| Test aligning sheets and wires together with multiple grid sizes. | |
Test for issue #22864: "Align Items to Grid" disconnects wires from hierarchical sheet pins.
Tests multiple scenarios:
Definition in file test_issue22864_align_sheet_pins.cpp.
| BOOST_FIXTURE_TEST_CASE | ( | AlignAllItemsCoarseGrid | , |
| ISSUE22864_FIXTURE | ) |
Test aligning all items with coarse grid (5.08mm).
Definition at line 473 of file test_issue22864_align_sheet_pins.cpp.
References BOOST_REQUIRE(), dummy, SCH_SCREEN::Items(), LoadSchematic(), EE_RTREE::OfType(), SCH_SHEET_T, and schIUScale.
| BOOST_FIXTURE_TEST_CASE | ( | AlignAllItemsFineGrid | , |
| ISSUE22864_FIXTURE | ) |
Test aligning all items with fine grid (1.27mm).
Definition at line 447 of file test_issue22864_align_sheet_pins.cpp.
References BOOST_REQUIRE(), dummy, SCH_SCREEN::Items(), LoadSchematic(), EE_RTREE::OfType(), SCH_SHEET_T, and schIUScale.
| BOOST_FIXTURE_TEST_CASE | ( | AlignAllItemsStandardGrid | , |
| ISSUE22864_FIXTURE | ) |
Test aligning all items with standard grid (2.54mm).
Definition at line 418 of file test_issue22864_align_sheet_pins.cpp.
References BOOST_FIXTURE_TEST_CASE(), BOOST_REQUIRE(), dummy, SCH_SCREEN::Items(), LoadSchematic(), EE_RTREE::OfType(), SCH_SHEET_T, and schIUScale.
| BOOST_FIXTURE_TEST_CASE | ( | AlignMultipleGridSizes | , |
| ISSUE22864_FIXTURE | ) |
Test aligning with multiple different grid sizes in sequence.
Definition at line 666 of file test_issue22864_align_sheet_pins.cpp.
References BOOST_REQUIRE(), dummy, SCH_SCREEN::Items(), LoadSchematic(), EE_RTREE::OfType(), SCH_SHEET_T, and schIUScale.
| BOOST_FIXTURE_TEST_CASE | ( | AlignSheet1Only | , |
| ISSUE22864_FIXTURE | ) |
Test aligning only sheet1 with standard grid.
When only one sheet is selected, wires should stretch/shrink to maintain connectivity without becoming skewed.
Definition at line 501 of file test_issue22864_align_sheet_pins.cpp.
References BOOST_REQUIRE(), dummy, SCH_SHEET::GetName(), SCH_SCREEN::Items(), LoadSchematic(), EE_RTREE::OfType(), SCH_SHEET_T, and schIUScale.
| BOOST_FIXTURE_TEST_CASE | ( | AlignSheet1ThenSheet2 | , |
| ISSUE22864_FIXTURE | ) |
Test aligning sheet1 then sheet2 sequentially.
When sheets are aligned one at a time, wires should stretch/shrink to maintain connectivity without becoming skewed.
Definition at line 574 of file test_issue22864_align_sheet_pins.cpp.
References BOOST_REQUIRE(), dummy, SCH_SHEET::GetName(), SCH_SCREEN::Items(), LoadSchematic(), EE_RTREE::OfType(), SCH_SHEET_T, and schIUScale.
| BOOST_FIXTURE_TEST_CASE | ( | AlignSheet2Only | , |
| ISSUE22864_FIXTURE | ) |
Test aligning only sheet2 with standard grid.
When only one sheet is selected, wires should stretch/shrink to maintain connectivity without becoming skewed.
Definition at line 537 of file test_issue22864_align_sheet_pins.cpp.
References BOOST_REQUIRE(), dummy, SCH_SHEET::GetName(), SCH_SCREEN::Items(), LoadSchematic(), EE_RTREE::OfType(), SCH_SHEET_T, and schIUScale.
| BOOST_FIXTURE_TEST_CASE | ( | AlignSheet2ThenSheet1 | , |
| ISSUE22864_FIXTURE | ) |
Test aligning sheet2 then sheet1 sequentially.
When sheets are aligned one at a time, wires should stretch/shrink to maintain connectivity without becoming skewed.
Definition at line 621 of file test_issue22864_align_sheet_pins.cpp.
References BOOST_REQUIRE(), dummy, SCH_SHEET::GetName(), SCH_SCREEN::Items(), LoadSchematic(), EE_RTREE::OfType(), SCH_SHEET_T, and schIUScale.
| BOOST_FIXTURE_TEST_CASE | ( | AlignSheetsAndWiresMultipleGrids | , |
| ISSUE22864_FIXTURE | ) |
Test aligning sheets and wires together with multiple grid sizes.
Definition at line 843 of file test_issue22864_align_sheet_pins.cpp.
References BOOST_REQUIRE(), dummy, SCH_ITEM::GetLayer(), SCH_SCREEN::Items(), LAYER_WIRE, LoadSchematic(), EE_RTREE::OfType(), SCH_LINE_T, SCH_SHEET_T, schIUScale, SELECTED, and EDA_ITEM::SetFlags().
| BOOST_FIXTURE_TEST_CASE | ( | AlignSheetsAndWiresTogether | , |
| ISSUE22864_FIXTURE | ) |
Test aligning when both sheets AND wires are selected together.
This is the critical case from issue #22864 - when "Select All" includes wires, the wires must still follow their connected sheet pins.
Definition at line 799 of file test_issue22864_align_sheet_pins.cpp.
References BOOST_REQUIRE(), dummy, SCH_ITEM::GetLayer(), SCH_SCREEN::Items(), LAYER_WIRE, LoadSchematic(), EE_RTREE::OfType(), SCH_LINE_T, SCH_SHEET_T, schIUScale, SELECTED, and EDA_ITEM::SetFlags().
| BOOST_FIXTURE_TEST_CASE | ( | VerifyPinWireYCoordinateMatch | , |
| ISSUE22864_FIXTURE | ) |
Test that aligning sheets preserves pin-to-wire Y coordinate match.
Definition at line 708 of file test_issue22864_align_sheet_pins.cpp.
References AlignSchematicItemsToGrid(), BOOST_REQUIRE(), EDA_ITEM::ClearFlags(), dummy, ENDPOINT, SCH_LINE::GetEndPoint(), SCH_ITEM::GetLayer(), SCH_SHEET::GetPins(), SCH_LINE::GetStartPoint(), grid, GRID_CONNECTABLE, SCH_SCREEN::Items(), LAYER_WIRE, LoadSchematic(), SCH_ALIGNMENT_CALLBACKS::m_doMoveItem, SCH_ALIGNMENT_CALLBACKS::m_getConnectedDragItems, MoveSchematicItem(), EE_RTREE::OfType(), pin, SCH_LINE_T, SCH_SHEET_T, schIUScale, EDA_ITEM::SetFlags(), STARTPOINT, EDA_ITEM::Type(), VECTOR2< T >::x, and VECTOR2< T >::y.