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

Test for issue #22864: "Align Items to Grid" disconnects wires from hierarchical sheet pins. More...

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.
 

Detailed Description

Test for issue #22864: "Align Items to Grid" disconnects wires from hierarchical sheet pins.

Tests multiple scenarios:

  • Select all items and align
  • Select individual sheets
  • Different grid spacings
  • Verify all wire endpoints connect to pins after alignment

Definition in file test_issue22864_align_sheet_pins.cpp.

Function Documentation

◆ BOOST_FIXTURE_TEST_CASE() [1/11]

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() [2/11]

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() [3/11]

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() [4/11]

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() [5/11]

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() [6/11]

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() [7/11]

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() [8/11]

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() [9/11]

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() [10/11]

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() [11/11]