|
KiCad PCB EDA Suite
|
#include <qa_utils/wx_utils/unit_test_utils.h>#include <symbol_library_manager.h>#include <symbol_editor/symbol_edit_frame.h>#include <symbol_editor/symbol_editor_tab_context.h>#include <symbol_editor/symbol_editor_settings.h>#include <lib_symbol.h>#include <sch_screen.h>#include <undo_redo_container.h>#include <settings/json_settings_internals.h>#include <nlohmann/json.hpp>Go to the source code of this file.
Classes | |
| class | INSTRUMENTED_LIB_SYMBOL |
| Headless tests for the Symbol Editor tabbed-document plumbing. More... | |
| struct | SYMBOL_EDITOR_TABS_TEST_FIXTURE |
Functions | |
| BOOST_AUTO_TEST_CASE (SymbolTabContextOwnsWorkingCopy) | |
| The context owns a working copy cloned from the buffer, seeds its dirty flag, and round-trips the per-tab unit and body style. | |
| BOOST_AUTO_TEST_CASE (InstanceTabContextIsTransientAndKeyedByUuid) | |
| An instance (schematic) tab owns its transient working symbol/screen, reports IsTransient(), and keys off the source instance UUID in a namespace disjoint from library keys. | |
| BOOST_AUTO_TEST_CASE (SymbolTabContextSeedsDirtyFromBuffer) | |
| Seeding from an already-modified buffer marks the new tab modified. | |
| BOOST_AUTO_TEST_CASE (OpenTabsJsonRoundTrip) | |
| Open-tab persistence round-trips through the settings JSON, including the active-tab key. | |
| BOOST_AUTO_TEST_CASE (FreeTransientUndoCommandsDeletesCopies) | |
| UR_TRANSIENT is flagged on the picked item, not the picker wrapper, so the container deleters that gate on the wrapper flag leaked these copies. | |
| BOOST_AUTO_TEST_CASE (FreeTransientUndoCommandsSparesLiveSymbol) | |
| The free helper must never delete the live working symbol, guarding the active-tab close path against a double-free. | |
| BOOST_AUTO_TEST_CASE | ( | FreeTransientUndoCommandsDeletesCopies | ) |
UR_TRANSIENT is flagged on the picked item, not the picker wrapper, so the container deleters that gate on the wrapper flag leaked these copies.
freeTransientUndoCommands walks the picked items and deletes exactly those carrying UR_TRANSIENT, which this exercises across the undo and redo lists.
Definition at line 217 of file test_symbol_editor_tabs.cpp.
References BOOST_CHECK_EQUAL(), redo, and undo.
| BOOST_AUTO_TEST_CASE | ( | FreeTransientUndoCommandsSparesLiveSymbol | ) |
The free helper must never delete the live working symbol, guarding the active-tab close path against a double-free.
The live item never carries UR_TRANSIENT, so it survives while a sibling transient command is freed.
Definition at line 243 of file test_symbol_editor_tabs.cpp.
References BOOST_CHECK_EQUAL(), LIBEDIT, PICKED_ITEMS_LIST::PushItem(), and undo.
| BOOST_AUTO_TEST_CASE | ( | InstanceTabContextIsTransientAndKeyedByUuid | ) |
An instance (schematic) tab owns its transient working symbol/screen, reports IsTransient(), and keys off the source instance UUID in a namespace disjoint from library keys.
Definition at line 132 of file test_symbol_editor_tabs.cpp.
References KIID::AsString(), BOOST_CHECK_EQUAL(), SYMBOL_EDITOR_TAB_CONTEXT::GetDisplayName(), SYMBOL_EDITOR_TAB_CONTEXT::GetReference(), SYMBOL_EDITOR_TAB_CONTEXT::GetSchematicSymbolUUID(), SYMBOL_EDITOR_TAB_CONTEXT::GetScreen(), SYMBOL_EDITOR_TAB_CONTEXT::GetSymbol(), SYMBOL_EDITOR_TAB_CONTEXT::GetTabKey(), SYMBOL_EDITOR_TAB_CONTEXT::IsFromSchematic(), SYMBOL_EDITOR_TAB_CONTEXT::IsTransient(), SYMBOL_EDITOR_TAB_CONTEXT::MakeInstanceTabKey(), and SYMBOL_EDITOR_TAB_CONTEXT::MakeTabKey().
| BOOST_AUTO_TEST_CASE | ( | OpenTabsJsonRoundTrip | ) |
Open-tab persistence round-trips through the settings JSON, including the active-tab key.
Definition at line 173 of file test_symbol_editor_tabs.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), JSON_SETTINGS_INTERNALS::CloneFrom(), JSON_SETTINGS::FormatAsString(), JSON_SETTINGS::Internals(), JSON_SETTINGS::Load(), SYMBOL_EDITOR_SETTINGS::m_ActiveTabKey, SYMBOL_EDITOR_SETTINGS::m_OpenTabs, and JSON_SETTINGS::Store().
| BOOST_AUTO_TEST_CASE | ( | SymbolTabContextOwnsWorkingCopy | ) |
The context owns a working copy cloned from the buffer, seeds its dirty flag, and round-trips the per-tab unit and body style.
Definition at line 95 of file test_symbol_editor_tabs.cpp.
References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), SYMBOL_EDITOR_TAB_CONTEXT::GetBodyStyle(), SYMBOL_EDITOR_TAB_CONTEXT::GetDisplayName(), LIB_SYMBOL::GetName(), SYMBOL_EDITOR_TAB_CONTEXT::GetScreen(), SYMBOL_EDITOR_TAB_CONTEXT::GetSymbol(), SYMBOL_EDITOR_TAB_CONTEXT::GetTabKey(), SYMBOL_EDITOR_TAB_CONTEXT::GetUnit(), SYMBOL_EDITOR_TAB_CONTEXT::IsModified(), SYMBOL_EDITOR_TAB_CONTEXT::SetBodyStyle(), BASE_SCREEN::SetContentModified(), and SYMBOL_EDITOR_TAB_CONTEXT::SetUnit().
| BOOST_AUTO_TEST_CASE | ( | SymbolTabContextSeedsDirtyFromBuffer | ) |
Seeding from an already-modified buffer marks the new tab modified.
Definition at line 162 of file test_symbol_editor_tabs.cpp.
References SYMBOL_EDITOR_TAB_CONTEXT::IsModified().