|
KiCad PCB EDA Suite
|
#include <boost/test/unit_test.hpp>#include <eda_pattern_match.h>#include <lib_id.h>#include <lib_tree_item.h>#include <lib_tree_model.h>#include <lib_tree_model_adapter.h>#include <project.h>#include <settings/app_settings.h>#include <wx/tokenzr.h>Go to the source code of this file.
Classes | |
| class | TEST_LIB_TREE_MODEL_ADAPTER |
| Minimal concrete adapter exposing the loaded column widths. More... | |
| class | TEST_LIB_TREE_ITEM |
| Stands in for LIB_SYMBOL, reproducing LIB_SYMBOL::cacheSearchTerms() term-for-term so the test exercises the same search-term shape (name, LIB_ID, individual keyword tokens, keyword blob, description) that a real symbol library produces. More... | |
Functions | |
| BOOST_AUTO_TEST_CASE (CorruptPersistedColumnWidthIgnoredOnLoad) | |
| A persisted column width can become corrupt after a mixed-DPI monitor change (issue 24702 reported width 427218649), which pushes the tree content off-screen and leaves the symbol/footprint chooser blank. | |
| BOOST_AUTO_TEST_CASE (SingleLetterSearchMatchesDeviceNameOverKeywordCollision) | |
| Typing a bare device-name letter (R, L, C, D) into the symbol chooser must land on the matching Device: symbol, not on some unrelated, "busier" symbol whose keywords happen to tokenize down to that same letter (issue 24404, still reproducible after the exact-match tier was introduced: a keyword token equalling the query earned the same tier as an item's actual name, and then the busier item's higher accumulated score won the tie-break). | |
| BOOST_AUTO_TEST_CASE | ( | CorruptPersistedColumnWidthIgnoredOnLoad | ) |
A persisted column width can become corrupt after a mixed-DPI monitor change (issue 24702 reported width 427218649), which pushes the tree content off-screen and leaves the symbol/footprint chooser blank.
Loading such a value must fall back to the sane default instead of applying it, while a legitimate persisted width is honoured.
Definition at line 111 of file test_lib_tree_model_adapter.cpp.
References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), APP_SETTINGS_BASE::LIB_TREE::column_widths, and TEST_LIB_TREE_MODEL_ADAPTER::LoadedWidth().
| BOOST_AUTO_TEST_CASE | ( | SingleLetterSearchMatchesDeviceNameOverKeywordCollision | ) |
Typing a bare device-name letter (R, L, C, D) into the symbol chooser must land on the matching Device: symbol, not on some unrelated, "busier" symbol whose keywords happen to tokenize down to that same letter (issue 24404, still reproducible after the exact-match tier was introduced: a keyword token equalling the query earned the same tier as an item's actual name, and then the busier item's higher accumulated score won the tie-break).
The decoys are the real ki_keywords/Description text of shipped symbols that collide this way: Potentiometer_Digital:AD5293 ("R POT"), Interface_USB:AP33771 ("USB Type C PD Sink"), and 74xGxx:74AUC1G74 ("Single D Flip-Flop D CMOS").
Definition at line 138 of file test_lib_tree_model_adapter.cpp.
References LIB_TREE_NODE_LIBRARY::AddItem(), LIB_TREE_NODE_ROOT::AddLib(), LIB_TREE_NODE::AssignIntrinsicRanks(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_CONTEXT(), CTX_LIBITEM, LIB_TREE_NODE::m_Children, LIB_TREE_NODE::m_ExactMatch, LIB_TREE_NODE::m_Name, LIB_TREE_NODE::SortNodes(), and LIB_TREE_NODE_ROOT::UpdateScore().