|
KiCad PCB EDA Suite
|
Test for issue #21821: copying a hierarchical sheet reassigns every diode the same reference. More...
#include <qa_utils/wx_utils/unit_test_utils.h>#include "eeschema_test_utils.h"#include <locale_io.h>#include <schematic.h>#include <sch_screen.h>#include <sch_sheet.h>#include <sch_sheet_path.h>#include <sch_symbol.h>#include <tools/sch_tool_utils.h>Go to the source code of this file.
Classes | |
| struct | ISSUE21821_FIXTURE |
Functions | |
| BOOST_FIXTURE_TEST_CASE (SharedScreenInstancesSurvivePaste, ISSUE21821_FIXTURE) | |
| The diode's instances are stored with no project name, so keying the paste cleanup on the project name discarded them and every sheet fell back to the same reference field. | |
| BOOST_FIXTURE_TEST_CASE (ProjectOwnedInstancesUntouched, ISSUE21821_FIXTURE) | |
| Symbols whose instances already name the project must come through the cleanup untouched. | |
| BOOST_FIXTURE_TEST_CASE (VirtualRootInstancesSurvivePaste, ISSUE21821_FIXTURE) | |
| A stored instance path may name the virtual root, which SCH_SHEET_PATH::Path() leaves out. | |
| BOOST_FIXTURE_TEST_CASE (ForeignAndPathlessInstancesPruned, ISSUE21821_FIXTURE) | |
| The cleanup still has to throw away what a paste really did drag in: paths rooted in another design, and the zero length paths that crash on save (issue #16300). | |
Variables | |
| static const wxString | LED0_PATH |
| Sheet path of the "dual gpio LED0" instance, taken from the reporter's files. | |
| static const wxString | LED8_PATH |
| Sheet path of the "dual gpio LED8" instance, which shares LED0's screen. | |
Test for issue #21821: copying a hierarchical sheet reassigns every diode the same reference.
Pasting a sheet whose file is already in the design reuses the live screen, so the paste cleanup runs over symbols that were never on the clipboard. In the reporter's design the LED_Dual symbol stores its per-sheet references under an empty project name while the resistors store theirs under the project name, which is why only the diodes lost their annotation.
Definition in file test_issue21821_sheet_copy_refs.cpp.
| BOOST_FIXTURE_TEST_CASE | ( | ForeignAndPathlessInstancesPruned | , |
| ISSUE21821_FIXTURE | ) |
The cleanup still has to throw away what a paste really did drag in: paths rooted in another design, and the zero length paths that crash on save (issue #16300).
Definition at line 214 of file test_issue21821_sheet_copy_refs.cpp.
References BOOST_CHECK_EQUAL(), SCH_SYMBOL_INSTANCE::m_Path, SCH_SYMBOL_INSTANCE::m_ProjectName, SCH_SYMBOL_INSTANCE::m_Reference, SCH_SYMBOL_INSTANCE::m_Unit, and PrunePastedSymbolInstances().
| BOOST_FIXTURE_TEST_CASE | ( | ProjectOwnedInstancesUntouched | , |
| ISSUE21821_FIXTURE | ) |
Symbols whose instances already name the project must come through the cleanup untouched.
Definition at line 130 of file test_issue21821_sheet_copy_refs.cpp.
References BOOST_CHECK_EQUAL(), SCH_SYMBOL::GetInstances(), SCH_SYMBOL::GetRef(), PrunePastedSymbolInstances(), and SCH_SYMBOL_T.
| BOOST_FIXTURE_TEST_CASE | ( | SharedScreenInstancesSurvivePaste | , |
| ISSUE21821_FIXTURE | ) |
The diode's instances are stored with no project name, so keying the paste cleanup on the project name discarded them and every sheet fell back to the same reference field.
Definition at line 107 of file test_issue21821_sheet_copy_refs.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), and PrunePastedSymbolInstances().
| BOOST_FIXTURE_TEST_CASE | ( | VirtualRootInstancesSurvivePaste | , |
| ISSUE21821_FIXTURE | ) |
A stored instance path may name the virtual root, which SCH_SHEET_PATH::Path() leaves out.
The cleanup has to read that form the way the s-expression writer does, or it condemns the design's own annotation.
Definition at line 163 of file test_issue21821_sheet_copy_refs.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), niluuid, and PrunePastedSymbolInstances().
|
static |
Sheet path of the "dual gpio LED0" instance, taken from the reporter's files.
Definition at line 49 of file test_issue21821_sheet_copy_refs.cpp.
Referenced by ISSUE21821_FIXTURE::ISSUE21821_FIXTURE().
|
static |
Sheet path of the "dual gpio LED8" instance, which shares LED0's screen.
Definition at line 54 of file test_issue21821_sheet_copy_refs.cpp.
Referenced by ISSUE21821_FIXTURE::ISSUE21821_FIXTURE().