20#include <boost/test/unit_test.hpp>
48 "s_inProgressLoads is not empty at test start" );
60 const wxString& aSymbolName,
63 const wxString& aInProgressKey )
72 const wxString& aSymbolName,
101 table.name =
"SelfRefDB";
102 table.table =
"Parts";
103 table.key_col =
"Part ID";
104 table.symbols_col =
"Symbols";
107 row[
table.symbols_col] = std::string(
"SelfRefDB:R-001" );
111 std::unique_ptr<LIB_SYMBOL> symbol =
115 BOOST_CHECK( symbol->GetName() == wxS(
"R-001" ) );
135 table.name =
"SelfRefDB";
136 table.table =
"Parts";
137 table.key_col =
"Part ID";
138 table.symbols_col =
"Symbols";
143 row[
table.symbols_col] = std::string(
"SomeLib:R-001" );
147 std::unique_ptr<LIB_SYMBOL> symbol = fixture.
Invoke( plugin, wxS(
"R-001" ),
table, row );
153 symbol = fixture.
Invoke( plugin, wxS(
"R-001" ),
table, row );
172 table.name =
"Parts";
173 table.table =
"Parts";
174 table.key_col =
"Part ID";
175 table.symbols_col =
"Symbols";
180 row[
table.symbols_col] = std::string(
"SomeLib:R-001" );
182 fixture.
Invoke( plugin, wxS(
"R-001" ),
table, row );
183 BOOST_CHECK(
reporter.GetMessages().IsEmpty() );
185 row[
table.symbols_col] = std::string(
"NotASymbol;SomeLib:R-001" );
187 fixture.
Invoke( plugin, wxS(
"R-001" ),
table, row );
189 wxString(
"'NotASymbol' is not a symbol; expected Library:Symbol.\n" ) );
std::map< std::string, std::any > ROW
virtual void SetReporter(REPORTER *aReporter)
Set an optional reporter for warnings/errors.
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...
A wrapper for reporting to a wxString object.
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()
IbisParser parser & reporter
BOOST_AUTO_TEST_CASE(DetectsAlreadyInProgressLibId)
BOOST_CHECK_EQUAL(result, "25.4")