20#include <boost/test/unit_test.hpp>
47 "s_inProgressLoads is not empty at test start" );
59 const wxString& aSymbolName,
62 const wxString& aInProgressKey )
71 const wxString& aSymbolName,
100 table.name =
"SelfRefDB";
101 table.table =
"Parts";
102 table.key_col =
"Part ID";
103 table.symbols_col =
"Symbols";
106 row[
table.symbols_col] = std::string(
"SelfRefDB:R-001" );
110 std::unique_ptr<LIB_SYMBOL> symbol =
114 BOOST_CHECK( symbol->GetName() == wxS(
"R-001" ) );
134 table.name =
"SelfRefDB";
135 table.table =
"Parts";
136 table.key_col =
"Part ID";
137 table.symbols_col =
"Symbols";
142 row[
table.symbols_col] = std::string(
"SomeLib:R-001" );
146 std::unique_ptr<LIB_SYMBOL> symbol = fixture.
Invoke( plugin, wxS(
"R-001" ),
table, row );
152 symbol = fixture.
Invoke( plugin, wxS(
"R-001" ),
table, row );
std::map< std::string, std::any > ROW
Regression test for https://gitlab.com/kicad/code/kicad/-/issues/24249.
std::unique_ptr< LIB_SYMBOL > InvokeWithCycle(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 o...
std::size_t InProgressSize(const SCH_IO_DATABASE &aPlugin) const
SCH_IO_DATABASE_CYCLE_DETECTION_FIXTURE()
bool IsInProgressEmpty(const SCH_IO_DATABASE &aPlugin) const
std::unique_ptr< LIB_SYMBOL > Invoke(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...
~SCH_IO_DATABASE_CYCLE_DETECTION_FIXTURE()
A KiCad database library provides both symbol and footprint metadata, so there are "shim" plugins on ...
static thread_local std::unordered_set< wxString > s_inProgressLoads
LIB_IDs whose resolution is in flight on the calling thread, used to break self-referential cycles wh...
void SetLibraryManagerAdapter(SYMBOL_LIBRARY_ADAPTER *aAdapter) override
Some library plugins need to interface with other loaded libraries.
std::unique_ptr< LIB_SYMBOL > loadSymbolFromRow(const wxString &aSymbolName, const DATABASE_LIB_TABLE &aTable, const DATABASE_CONNECTION::ROW &aRow)
An interface to the global shared library manager that is schematic-specific and linked to one projec...
static bool empty(const wxTextEntryBase *aCtrl)
A database library table will be mapped to a sub-library provided by the database library entry in th...
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(DetectsAlreadyInProgressLibId)
BOOST_CHECK_EQUAL(result, "25.4")