|
KiCad PCB EDA Suite
|
#include <qa_utils/wx_utils/unit_test_utils.h>#include <libraries/symbol_library_adapter.h>#include <libraries/library_manager.h>#include <wx/textfile.h>#include <filesystem>Go to the source code of this file.
Functions | |
| BOOST_AUTO_TEST_CASE (IsSymbolLibWritableHandlesFailedLoad) | |
| Regression test for a null-plugin dereference crash. | |
| BOOST_AUTO_TEST_CASE (GetLibraryNamesSortedRegardlessOfTableOrder) | |
| Regression test for https://gitlab.com/kicad/code/kicad/-/issues/23066. | |
| BOOST_AUTO_TEST_CASE (PartiallyLoadedTableReportsNoSpuriousErrors) | |
| Regression test for https://gitlab.com/kicad/code/kicad/-/issues/22764. | |
| BOOST_AUTO_TEST_CASE | ( | GetLibraryNamesSortedRegardlessOfTableOrder | ) |
Regression test for https://gitlab.com/kicad/code/kicad/-/issues/23066.
The library browsers list nicknames straight from GetLibraryNames(). When personal libraries were appended to the table after the default ones, the raw table order left them grouped at the bottom instead of interleaved alphabetically. GetLibraryNames() must return the available nicknames in case-insensitive natural order regardless of table order.
Definition at line 141 of file test_symbol_library_adapter.cpp.
References expected, and LIBRARY_MANAGER::LoadProjectTables().
| BOOST_AUTO_TEST_CASE | ( | IsSymbolLibWritableHandlesFailedLoad | ) |
Regression test for a null-plugin dereference crash.
A symbol library that fails to load leaves a LOAD_ERROR sentinel with a null plugin in the adapter's map. IsSymbolLibWritable() is called for every table row by the symbol editor and chooser, so it must report such a library as not writable instead of dereferencing the null plugin.
Definition at line 119 of file test_symbol_library_adapter.cpp.
References BOOST_AUTO_TEST_CASE(), and BOOST_CHECK_EQUAL().
| BOOST_AUTO_TEST_CASE | ( | PartiallyLoadedTableReportsNoSpuriousErrors | ) |
Regression test for https://gitlab.com/kicad/code/kicad/-/issues/22764.
With "remember open files" enabled the schematic auto-opens and loads symbols on demand while the background preload is still enumerating the library table. At any instant some enabled table rows have no loaded entry yet. GetLibraryLoadErrors() collects the status of every enabled row, and a row present in the table but not yet loaded must not be reported as a load error, otherwise a spurious error indicator appears and its count varies with the load timing from one launch to the next. Genuine failures still carry a real error message and must still be reported.
Definition at line 176 of file test_symbol_library_adapter.cpp.
References LIBRARY_MANAGER::LoadProjectTables().