|
KiCad PCB EDA Suite
|
Test for issue #24107: Unexpected multi-unit symbol grouping behavior. More...
#include <boost/test/unit_test.hpp>#include <lib_id.h>#include <lib_symbol.h>#include <sch_reference_list.h>#include <sch_screen.h>#include <sch_sheet.h>#include <sch_sheet_path.h>#include <sch_symbol.h>#include <schematic.h>#include <settings/settings_manager.h>#include <tools/sch_tool_utils.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 | ISSUE24107_FIXTURE |
Functions | |
| BOOST_AUTO_TEST_CASE (UnplacedUnitsAreScopedToLibraryIdentity) | |
| Reproduces the user-reported flow. | |
| BOOST_AUTO_TEST_CASE (UnannotatedUnitsFromOtherLibraryAreIgnored) | |
| When a fresh OPA1664 is placed first, its own unit 1 should be marked as occupied while the remaining units (2, 3, 4) should be reported as unplaced. | |
| BOOST_AUTO_TEST_CASE (SameLibraryUnitsStillCount) | |
| Two different unannotated multi-unit symbols sharing the same reference prefix and unit number must not be aliased. | |
| BOOST_AUTO_TEST_CASE (IsUnannotatedUnitOccupiedRespectsLibraryIdentity) | |
| Direct coverage for the helper consumed by SCH_DRAWING_TOOLS::PlaceSymbol() in placeAllUnits mode. | |
Test for issue #24107: Unexpected multi-unit symbol grouping behavior.
Pre-annotation, when units of one multi-unit library symbol (e.g. AD8620, three units) are placed and then a different multi-unit library symbol (e.g. OPA1664, four units) is placed with the same reference prefix ("U?"), the second symbol must NOT be treated as a continuation of the first symbol's units.
GetUnplacedUnitsForSymbol previously returned the missing units of the merged "U? prefix" pseudo-component, which made an OPA1664 placed after three AD8620 units jump to unit D (4) instead of starting at unit A (1).
Definition in file test_issue24107_multiunit_grouping.cpp.
| BOOST_AUTO_TEST_CASE | ( | IsUnannotatedUnitOccupiedRespectsLibraryIdentity | ) |
Direct coverage for the helper consumed by SCH_DRAWING_TOOLS::PlaceSymbol() in placeAllUnits mode.
The helper must agree with the ref/lib-id-based identity check used by GetUnplacedUnitsForSymbol(), but operates on a pre-built SCH_REFERENCE_LIST rather than walking the hierarchy.
Definition at line 218 of file test_issue24107_multiunit_grouping.cpp.
References SCH_SHEET_LIST::GetSymbols(), IsUnannotatedUnitOccupied(), and SYMBOL_FILTER_ALL.
| BOOST_AUTO_TEST_CASE | ( | SameLibraryUnitsStillCount | ) |
Two different unannotated multi-unit symbols sharing the same reference prefix and unit number must not be aliased.
AD8620 unit 2 is occupied for AD8620 itself, regardless of which OPA1664 units are present.
Definition at line 195 of file test_issue24107_multiunit_grouping.cpp.
References BOOST_CHECK_EQUAL(), and GetUnplacedUnitsForSymbol().
| BOOST_AUTO_TEST_CASE | ( | UnannotatedUnitsFromOtherLibraryAreIgnored | ) |
When a fresh OPA1664 is placed first, its own unit 1 should be marked as occupied while the remaining units (2, 3, 4) should be reported as unplaced.
AD8620 units sitting on the same sheet must not affect the result.
Definition at line 170 of file test_issue24107_multiunit_grouping.cpp.
References BOOST_CHECK_EQUAL(), and GetUnplacedUnitsForSymbol().
| BOOST_AUTO_TEST_CASE | ( | UnplacedUnitsAreScopedToLibraryIdentity | ) |
Reproduces the user-reported flow.
Before the fix the function reports {} (because U?A/U?B/U?C of AD8620 are mistakenly counted as occupying OPA1664's first three units, and U?A of OPA1664 covers unit 4). After the fix the function must report units 2, 3, 4 as unplaced for the OPA1664 placement, because those units of OPA1664 itself have not yet been placed.
Definition at line 143 of file test_issue24107_multiunit_grouping.cpp.
References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), and GetUnplacedUnitsForSymbol().