KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_issue24297_http_migrate.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <cstring>
#include <wx/filename.h>
#include <wx/wfstream.h>
#include <sch_io/sch_io_mgr.h>

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (HttpLibraryRejectedByConvertLibrary)
 Test for issue #24297: Migrate http library fails.
 
 BOOST_AUTO_TEST_CASE (DatabaseLibraryRejectedByConvertLibrary)
 Database libraries are also non-file backends and must be rejected by ConvertLibrary.
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/2]

BOOST_AUTO_TEST_CASE ( DatabaseLibraryRejectedByConvertLibrary )

Database libraries are also non-file backends and must be rejected by ConvertLibrary.

Definition at line 92 of file test_issue24297_http_migrate.cpp.

References BOOST_REQUIRE(), SCH_IO_MGR::ConvertLibrary(), and SCH_IO_MGR::GuessPluginTypeFromLibPath().

◆ BOOST_AUTO_TEST_CASE() [2/2]

BOOST_AUTO_TEST_CASE ( HttpLibraryRejectedByConvertLibrary )

Test for issue #24297: Migrate http library fails.

SCH_IO_MGR::ConvertLibrary previously accepted live backends (HTTP, DATABASE) and silently produced an empty .kicad_sym file, replacing the original table entry and destroying the user's library reference. The converter must now reject these backends so the caller can surface an error instead. A .kicad_httplib config (HTTP source) is not migratable to a .kicad_sym snapshot.

Before the fix, ConvertLibrary would dispatch to SCH_IO_HTTP_LIB::EnumerateSymbolLib which silently returned no symbols when the library manager adapter was unset (as it always is from this code path) and then wrote an empty .kicad_sym, allowing the caller to clobber the user's table entry. The guard in ConvertLibrary makes this fast-fail.

Definition at line 49 of file test_issue24297_http_migrate.cpp.

References BOOST_AUTO_TEST_CASE(), BOOST_REQUIRE(), SCH_IO_MGR::ConvertLibrary(), and SCH_IO_MGR::GuessPluginTypeFromLibPath().