|
KiCad PCB EDA Suite
|
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. | |
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.
| BOOST_AUTO_TEST_CASE | ( | TestSheetFoundInHierarchyAfterRefresh | ) |
Test that after adding a sheet and refreshing the hierarchy, the sheet path can be found via GetSheetsWithinPath.
Definition at line 95 of file test_issue22651_sheet_annotation.cpp.
References SCH_SCREEN::Append(), BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), SCH_SHEET::GetField(), SCH_SHEET::GetScreen(), SCH_SCREEN::SetFileName(), SCH_SYMBOL::SetPosition(), SCH_SHEET::SetScreen(), SCH_FIELD::SetText(), SHEET_FILENAME, and SHEET_NAME.
| 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.
Definition at line 145 of file test_issue22651_sheet_annotation.cpp.
References SCH_SCREEN::Append(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), SCH_REFERENCE_LIST::GetCount(), SCH_SHEET::GetField(), SCH_SHEET::GetScreen(), SCH_SHEET_LIST::GetSheetsWithinPath(), SCH_SHEET_LIST::GetSymbolsWithinPath(), SCH_SHEET_PATH::push_back(), SCH_SCREEN::SetFileName(), SCH_SYMBOL::SetPosition(), SCH_SHEET::SetScreen(), SCH_FIELD::SetText(), SHEET_FILENAME, and SHEET_NAME.
| BOOST_AUTO_TEST_CASE | ( | TestSymbolsNotFoundWithoutRefresh | ) |
Test that without refreshing the hierarchy, symbols in newly added sheets cannot be found.
This verifies the root cause of issue 22651.
Definition at line 208 of file test_issue22651_sheet_annotation.cpp.
References SCH_SCREEN::Append(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), SCH_REFERENCE_LIST::GetCount(), SCH_SHEET::GetField(), SCH_SHEET::GetScreen(), SCH_SHEET_LIST::GetSheetsWithinPath(), SCH_SHEET_LIST::GetSymbolsWithinPath(), SCH_SHEET_PATH::push_back(), SCH_SCREEN::SetFileName(), SCH_SYMBOL::SetPosition(), SCH_SHEET::SetScreen(), SCH_FIELD::SetText(), and SHEET_FILENAME.