|
KiCad PCB EDA Suite
|
#include <boost/test/unit_test.hpp>#include <connection_graph.h>#include <netlist_exporter_xml.h>#include <sch_io/kicad_sexpr/sch_io_kicad_sexpr.h>#include <sch_netchain.h>#include <sch_screen.h>#include <sch_sheet.h>#include <schematic.h>#include <settings/settings_manager.h>#include <locale_io.h>#include <qa_utils/wx_utils/unit_test_utils.h>#include <wx/ffile.h>#include <wx/filename.h>#include <wx/stdpaths.h>#include <wx/xml/xml.h>Go to the source code of this file.
Classes | |
| struct | NETCHAIN_SYNTHETIC_FILTER_FIXTURE |
Functions | |
| void | boost_test_inject_committed_net_chain (CONNECTION_GRAPH &aGraph, std::unique_ptr< SCH_NETCHAIN > aChain) |
| static wxXmlNode * | find_child (wxXmlNode *parent, const wxString &name) |
| BOOST_FIXTURE_TEST_CASE (NetChainSyntheticNamesAreFilteredFromOutputs, NETCHAIN_SYNTHETIC_FILTER_FIXTURE) | |
| Regression: synthetic per-run subgraph names (__SG_*) embed subgraph codes that are not stable across reloads. | |
| BOOST_FIXTURE_TEST_CASE | ( | NetChainSyntheticNamesAreFilteredFromOutputs | , |
| NETCHAIN_SYNTHETIC_FILTER_FIXTURE | ) |
Regression: synthetic per-run subgraph names (__SG_*) embed subgraph codes that are not stable across reloads.
The sexpr writer filters them out at sch_io_kicad_sexpr.cpp, but the XML netlist exporter previously emitted every member of the chain verbatim, leaking unresolvable names into third-party netlist consumers (KiCost, custom BOM pipelines). Reloading the netlist could not match these synthetic strings against any real BOARD net, so the chain assignment was silently dropped.
This test injects a committed chain that mixes real net names with a __SG_* member, runs both the XML exporter (KiCad-internal flag) and the sexpr writer over a single fixture, and asserts that neither output contains the synthetic substring while the real members survive.
Definition at line 119 of file test_net_chain_synthetic_filter.cpp.
References BOOST_CHECK_MESSAGE(), BOOST_REQUIRE(), boost_test_inject_committed_net_chain(), chain, SCHEMATIC::ConnectionGraph(), dummy, find_child(), WX_STRING_REPORTER::GetMessages(), CONNECTION_GRAPH::GetNetChainMemberNetOverrides(), SCH_SHEET::GetScreen(), GNL_OPT_KICAD, SCH_IO_KICAD_SEXPR::LoadSchematicFile(), SCH_IO_KICAD_SEXPR::SaveSchematicFile(), SCH_SCREEN::SetFileName(), SCH_SHEET::SetFileName(), SCHEMATIC::SetProject(), and SCH_NETCHAIN::SYNTHETIC_NET_PREFIX.
| void boost_test_inject_committed_net_chain | ( | CONNECTION_GRAPH & | aGraph, |
| std::unique_ptr< SCH_NETCHAIN > | aChain ) |
Definition at line 394 of file test_net_chain_save_root_only.cpp.
Referenced by BOOST_FIXTURE_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().
|
static |
Definition at line 94 of file test_net_chain_synthetic_filter.cpp.
References name.
Referenced by BOOST_FIXTURE_TEST_CASE().