|
KiCad PCB EDA Suite
|
Test for issue #22620: Symbols are not automatically annotated when placing design blocks. More...
#include <boost/test/unit_test.hpp>#include <sch_group.h>#include <sch_screen.h>#include <sch_symbol.h>#include <schematic.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 | GROUP_ANNOTATION_FIXTURE |
Functions | |
| BOOST_AUTO_TEST_CASE (TestGroupRunOnChildrenFindsSymbols) | |
| Test that SCH_GROUP::RunOnChildren correctly finds symbols inside a group. | |
| BOOST_AUTO_TEST_CASE (TestGroupRunOnChildrenWithNestedGroups) | |
| Test that SCH_GROUP::RunOnChildren handles nested groups correctly. | |
Test for issue #22620: Symbols are not automatically annotated when placing design blocks.
When placing a design block as a group with auto-annotation enabled and "Keep Annotations" disabled, symbols in the group should be automatically annotated. The root cause was that getInferredSymbols() in annotate.cpp did not handle SCH_GROUP_T items, so symbols inside groups were not found and thus not annotated.
This test verifies that SCH_GROUP::RunOnChildren correctly iterates through group members, which is the mechanism used by the fix.
Definition in file test_issue22620_group_annotation.cpp.
| BOOST_AUTO_TEST_CASE | ( | TestGroupRunOnChildrenFindsSymbols | ) |
Test that SCH_GROUP::RunOnChildren correctly finds symbols inside a group.
This verifies the mechanism used by the fix for issue #22620.
Definition at line 92 of file test_issue22620_group_annotation.cpp.
References SCH_SCREEN::Append(), BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), group, RECURSE, SCH_SYMBOL_T, SCH_SYMBOL::SetPosition(), and EDA_ITEM::Type().
| BOOST_AUTO_TEST_CASE | ( | TestGroupRunOnChildrenWithNestedGroups | ) |
Test that SCH_GROUP::RunOnChildren handles nested groups correctly.
Definition at line 141 of file test_issue22620_group_annotation.cpp.
References EDA_GROUP::AddItem(), SCH_SCREEN::Append(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), RECURSE, SCH_GROUP::RunOnChildren(), SCH_SYMBOL_T, EDA_GROUP::SetName(), SCH_SYMBOL::SetPosition(), and EDA_ITEM::Type().