KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SCH_IO_DATABASE_CYCLE_DETECTION_FIXTURE Class Reference

Regression test for https://gitlab.com/kicad/code/kicad/-/issues/24249. More...

Public Member Functions

 SCH_IO_DATABASE_CYCLE_DETECTION_FIXTURE ()=default
 
std::unique_ptr< LIB_SYMBOLInvokeWithCycle (SCH_IO_DATABASE &aPlugin, const wxString &aSymbolName, const DATABASE_LIB_TABLE &aTable, const DATABASE_CONNECTION::ROW &aRow, const wxString &aInProgressKey)
 Drive loadSymbolFromRow with aInProgressKey already marked in-progress, simulating the second entry of a recursive load.
 
std::unique_ptr< LIB_SYMBOLInvoke (SCH_IO_DATABASE &aPlugin, const wxString &aSymbolName, const DATABASE_LIB_TABLE &aTable, const DATABASE_CONNECTION::ROW &aRow)
 Drive loadSymbolFromRow without pre-seeding the in-progress set; the plugin inserts and (via its RAII guard) removes its own entry.
 
bool IsInProgressEmpty (const SCH_IO_DATABASE &aPlugin) const
 
std::size_t InProgressSize (const SCH_IO_DATABASE &aPlugin) const
 

Detailed Description

Regression test for https://gitlab.com/kicad/code/kicad/-/issues/24249.

When a database row's Symbols column references the database library itself, SCH_IO_DATABASE::loadSymbolFromRow used to recurse through the adapter back into its own LoadSymbol entry point and blow the stack. We drive loadSymbolFromRow directly through a friend fixture; an end-to-end test would need a live Pgm()/project loader and a SQLite ODBC driver, neither of which the unit harness provides.

Definition at line 39 of file test_sch_io_database_cycle.cpp.

Constructor & Destructor Documentation

◆ SCH_IO_DATABASE_CYCLE_DETECTION_FIXTURE()

SCH_IO_DATABASE_CYCLE_DETECTION_FIXTURE::SCH_IO_DATABASE_CYCLE_DETECTION_FIXTURE ( )
default

Member Function Documentation

◆ InProgressSize()

std::size_t SCH_IO_DATABASE_CYCLE_DETECTION_FIXTURE::InProgressSize ( const SCH_IO_DATABASE & aPlugin) const
inline

Definition at line 71 of file test_sch_io_database_cycle.cpp.

References SCH_IO_DATABASE::m_inProgressLoads.

Referenced by BOOST_AUTO_TEST_CASE().

◆ Invoke()

std::unique_ptr< LIB_SYMBOL > SCH_IO_DATABASE_CYCLE_DETECTION_FIXTURE::Invoke ( SCH_IO_DATABASE & aPlugin,
const wxString & aSymbolName,
const DATABASE_LIB_TABLE & aTable,
const DATABASE_CONNECTION::ROW & aRow )
inline

Drive loadSymbolFromRow without pre-seeding the in-progress set; the plugin inserts and (via its RAII guard) removes its own entry.

Definition at line 58 of file test_sch_io_database_cycle.cpp.

References SCH_IO_DATABASE::loadSymbolFromRow().

Referenced by BOOST_AUTO_TEST_CASE().

◆ InvokeWithCycle()

std::unique_ptr< LIB_SYMBOL > SCH_IO_DATABASE_CYCLE_DETECTION_FIXTURE::InvokeWithCycle ( SCH_IO_DATABASE & aPlugin,
const wxString & aSymbolName,
const DATABASE_LIB_TABLE & aTable,
const DATABASE_CONNECTION::ROW & aRow,
const wxString & aInProgressKey )
inline

Drive loadSymbolFromRow with aInProgressKey already marked in-progress, simulating the second entry of a recursive load.

Definition at line 46 of file test_sch_io_database_cycle.cpp.

References SCH_IO_DATABASE::loadSymbolFromRow(), and SCH_IO_DATABASE::m_inProgressLoads.

Referenced by BOOST_AUTO_TEST_CASE().

◆ IsInProgressEmpty()

bool SCH_IO_DATABASE_CYCLE_DETECTION_FIXTURE::IsInProgressEmpty ( const SCH_IO_DATABASE & aPlugin) const
inline

Definition at line 66 of file test_sch_io_database_cycle.cpp.

References SCH_IO_DATABASE::m_inProgressLoads.

Referenced by BOOST_AUTO_TEST_CASE().


The documentation for this class was generated from the following file: