|
KiCad PCB EDA Suite
|
#include <filesystem>#include <fstream>#include <mock_pgm_base.h>#include <richio.h>#include <io/kicad/kicad_io_utils.h>#include <qa_utils/wx_utils/unit_test_utils.h>#include <settings/settings_manager.h>#include <pegtl/contrib/analyze.hpp>#include <libraries/library_manager.h>#include <libraries/library_table.h>#include <libraries/library_table_parser.h>#include <libraries/library_table_grammar.h>Go to the source code of this file.
Functions | |
| BOOST_AUTO_TEST_CASE (Grammar) | |
| BOOST_AUTO_TEST_CASE (EmptyString) | |
| BOOST_AUTO_TEST_CASE (ParseFromFile) | |
| BOOST_AUTO_TEST_CASE (ParseAndConstruct) | |
| BOOST_AUTO_TEST_CASE (Manager) | |
| BOOST_AUTO_TEST_CASE (NestedTablesDisabledHidden) | |
| BOOST_AUTO_TEST_CASE (InsertRowPreservesExistingRowPointers) | |
| Regression test: inserting rows into a loaded LIBRARY_TABLE must not invalidate pointers or references to previously-captured rows. | |
| BOOST_AUTO_TEST_CASE (IsPcmManagedRow_URITemplateMatching) | |
| Regression test for the PCM auto-remove identification predicate. | |
| BOOST_AUTO_TEST_CASE | ( | EmptyString | ) |
Definition at line 46 of file test_library_tables.cpp.
References BOOST_REQUIRE(), LIBRARY_TABLE_PARSER::ParseBuffer(), and result.
| BOOST_AUTO_TEST_CASE | ( | Grammar | ) |
Definition at line 40 of file test_library_tables.cpp.
References BOOST_AUTO_TEST_CASE(), and BOOST_REQUIRE().
| BOOST_AUTO_TEST_CASE | ( | InsertRowPreservesExistingRowPointers | ) |
Regression test: inserting rows into a loaded LIBRARY_TABLE must not invalidate pointers or references to previously-captured rows.
The remote symbol import path (EnsureRemoteLibraryEntry) calls InsertRow() at runtime while LIB_DATA instances and LIBRARY_MANAGER::m_rowCache hold raw pointers into the rows container. A std::vector-backed container would reallocate on growth and leave those pointers dangling, which produced an intermittent std::bad_alloc crash deep in KIwxExpandEnvVars when the next symbol placement tried to read the stale URI.
Definition at line 228 of file test_library_tables.cpp.
References PROJECT, LIBRARY_TABLE_ROW::SetNickname(), LIBRARY_TABLE_ROW::SetType(), LIBRARY_TABLE_ROW::SetURI(), SYMBOL, table, and LIBRARY_TABLE_ROW::URI().
| BOOST_AUTO_TEST_CASE | ( | IsPcmManagedRow_URITemplateMatching | ) |
Regression test for the PCM auto-remove identification predicate.
Rows inserted by the PCM traverser reference ${KICADn_3RD_PARTY} directly, so matching on the URI template uniquely identifies them and avoids cleaning up user-added libraries whose expanded absolute paths happen to be descendants of the 3RD_PARTY directory via a different env var (e.g. ${KICAD_USER_LIB} pointing to ${KICAD10_3RD_PARTY}/V10).
Prior to this fix, cleanupRemovedPCMLibraries did a raw prefix check on the expanded path, mis-identifying overlapping user libraries as PCM-managed and silently deleting their rows any time the file was temporarily absent. The user-visible symptom was "Could not create the library file" when adding a new library through the symbol editor.
Definition at line 284 of file test_library_tables.cpp.
References actual, BOOST_CHECK_MESSAGE(), LIBRARY_MANAGER::IsPcmManagedRow(), and LIBRARY_TABLE_ROW::SetURI().
| BOOST_AUTO_TEST_CASE | ( | Manager | ) |
Definition at line 150 of file test_library_tables.cpp.
References BOOST_REQUIRE(), FOOTPRINT, LIBRARY_MANAGER::LoadGlobalTables(), LIBRARY_MANAGER::Rows(), and SYMBOL.
| BOOST_AUTO_TEST_CASE | ( | NestedTablesDisabledHidden | ) |
Definition at line 160 of file test_library_tables.cpp.
References BOOST_REQUIRE(), KI_TEST::GetTestDataRootDir(), GLOBAL, LIBRARY_TABLE::IsOk(), LIBRARY_TABLE::Rows(), and LIBRARY_TABLE_ROW::TABLE_TYPE_NAME.
| BOOST_AUTO_TEST_CASE | ( | ParseAndConstruct | ) |
Definition at line 78 of file test_library_tables.cpp.
References BOOST_REQUIRE(), BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), STRING_FORMATTER::GetString(), KI_TEST::GetTestDataRootDir(), GLOBAL, STRING_FORMATTER::MutableString(), KICAD_FORMAT::Prettify(), and table.
| BOOST_AUTO_TEST_CASE | ( | ParseFromFile | ) |
Definition at line 54 of file test_library_tables.cpp.
References BOOST_REQUIRE(), KI_TEST::GetTestDataRootDir(), LIBRARY_TABLE_PARSER::Parse(), path, and result.