KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_symbol_editor_tabs.cpp File Reference

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.
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/6]

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() [2/6]

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() [3/6]

◆ BOOST_AUTO_TEST_CASE() [4/6]

BOOST_AUTO_TEST_CASE ( OpenTabsJsonRoundTrip )

◆ BOOST_AUTO_TEST_CASE() [5/6]

◆ BOOST_AUTO_TEST_CASE() [6/6]

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().