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

Test for issue #22651: Symbols are not reannotated when placing design blocks as sheets. More...

#include <boost/test/unit_test.hpp>
#include <sch_screen.h>
#include <sch_sheet.h>
#include <sch_sheet_path.h>
#include <sch_symbol.h>
#include <schematic.h>
#include <sch_reference_list.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  SHEET_ANNOTATION_FIXTURE
 

Functions

 BOOST_AUTO_TEST_CASE (TestSheetFoundInHierarchyAfterRefresh)
 Test that after adding a sheet and refreshing the hierarchy, the sheet path can be found via GetSheetsWithinPath.
 
 BOOST_AUTO_TEST_CASE (TestSymbolsFoundInNewSheetAfterRefresh)
 Test that symbols inside a newly added sheet can be found via GetSymbolsWithinPath after refreshing the hierarchy, which is the mechanism used by annotation.
 
 BOOST_AUTO_TEST_CASE (TestSymbolsNotFoundWithoutRefresh)
 Test that without refreshing the hierarchy, symbols in newly added sheets cannot be found.
 

Detailed Description

Test for issue #22651: Symbols are not reannotated when placing design blocks as sheets.

When placing a design block as a sheet with "Keep Annotations" disabled, symbols inside the sheet should be reannotated. The root cause was that the schematic hierarchy cache was not refreshed after adding the new sheet to the screen, so the annotation function couldn't find the sheet or its symbols in the hierarchy.

This test verifies that after refreshing the hierarchy, newly added sheets and their symbols can be found via GetSheetsWithinPath and GetSymbolsWithinPath, which are the mechanisms used by the annotation system.

Definition in file test_issue22651_sheet_annotation.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/3]

BOOST_AUTO_TEST_CASE ( TestSheetFoundInHierarchyAfterRefresh )

◆ BOOST_AUTO_TEST_CASE() [2/3]

BOOST_AUTO_TEST_CASE ( TestSymbolsFoundInNewSheetAfterRefresh )

◆ BOOST_AUTO_TEST_CASE() [3/3]

BOOST_AUTO_TEST_CASE ( TestSymbolsNotFoundWithoutRefresh )