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

Test for issue #21798: Copying or duplicating a sheet with bus connector kills labels. More...

#include <qa_utils/wx_utils/unit_test_utils.h>
#include <schematic_utils/schematic_file_util.h>
#include <connection_graph.h>
#include <schematic.h>
#include <sch_sheet.h>
#include <sch_sheet_pin.h>
#include <sch_screen.h>
#include <sch_label.h>
#include <sch_bus_entry.h>
#include <sch_line.h>
#include <sch_symbol.h>
#include <sch_pin.h>
#include <settings/settings_manager.h>
#include <locale_io.h>

Go to the source code of this file.

Classes

struct  ISSUE21798_FIXTURE
 

Functions

 BOOST_FIXTURE_TEST_CASE (Issue21798DuplicatedSheetBusConnectivity, ISSUE21798_FIXTURE)
 Test that two sheets with the same bus pin name both have working bus connectivity.
 

Detailed Description

Test for issue #21798: Copying or duplicating a sheet with bus connector kills labels.

When two hierarchical sheets with the same bus pin name exist on the same parent sheet (as happens after copy/duplicate), both sheets' bus connections must produce valid bus_neighbor links so that hierarchy propagation works through both buses.

Definition in file test_issue21798_bus_sheet_copy.cpp.

Function Documentation

◆ BOOST_FIXTURE_TEST_CASE()

BOOST_FIXTURE_TEST_CASE ( Issue21798DuplicatedSheetBusConnectivity ,
ISSUE21798_FIXTURE  )

Test that two sheets with the same bus pin name both have working bus connectivity.

The test schematic has Sheet1 and Sheet2, each with bus pin D[0..1]. Both buses connect through bus entries to labels D0/D1, which connect to connectors J1/J2.

Without the fix, processSubGraphs() renames one bus from D[0..1] to D[0..1]_1 and SetSuffix() also renames bus members from D0 to D0_1. The matching code then can't find label subgraphs for D0_1, so the renamed bus gets no bus_neighbor links and hierarchy propagation breaks for that sheet.

Definition at line 71 of file test_issue21798_bus_sheet_copy.cpp.

References BOOST_CHECK_MESSAGE(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), dummy, CONNECTION_GRAPH::GetNetMap(), EDA_TEXT::GetText(), SCH_CONNECTION::IsBus(), KI_TEST::LoadSchematic(), SCH_CONNECTION::Name(), and SCH_LABEL_T.