KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_net_chain_resolve_terminals.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <connection_graph.h>
#include <sch_netchain.h>
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <map>
#include <memory>
#include <utility>
#include <vector>

Go to the source code of this file.

Typedefs

using REF_PIN_KEY = std::pair<wxString, wxString>
 Regression for [H-5].
 
using REF_PIN_TO_NET = std::map<REF_PIN_KEY, wxString>
 
using TERM_PAIR = std::pair<REF_PIN_KEY, REF_PIN_KEY>
 

Functions

SCH_NETCHAINboost_test_resolve_potential_chain_by_terminals (const std::pair< std::pair< wxString, wxString >, std::pair< wxString, wxString > > &aTerms, const std::map< std::pair< wxString, wxString >, wxString > &aRefPinToNet, const std::vector< std::unique_ptr< SCH_NETCHAIN > > &aPotentials, const wxString &aChainName)
 
static std::unique_ptr< SCH_NETCHAINmakePotential (const wxString &aName, std::initializer_list< wxString > aNets)
 
 BOOST_AUTO_TEST_CASE (PicksChainContainingBothTerminalNets)
 
 BOOST_AUTO_TEST_CASE (ReturnsNullWhenNoPotentialSpansBothEndpoints)
 
 BOOST_AUTO_TEST_CASE (ReturnsNullWhenEitherTerminalUnresolvable)
 
 BOOST_AUTO_TEST_CASE (SwappedTerminalOrderStillResolves)
 
 BOOST_AUTO_TEST_CASE (ResolvesWhenOneEndpointIsUnnamedSyntheticName)
 

Typedef Documentation

◆ REF_PIN_KEY

using REF_PIN_KEY = std::pair<wxString, wxString>

Regression for [H-5].

The chain restore path used to resolve only the saved 'from' terminal and pick the first potential chain whose net set contained that single net. When two potential chains shared a 'from' net but diverged at the 'to' end, the wrong chain was promoted on reload. The fix resolves both endpoints and requires the candidate to span BOTH endpoint nets.

Definition at line 63 of file test_net_chain_resolve_terminals.cpp.

◆ REF_PIN_TO_NET

using REF_PIN_TO_NET = std::map<REF_PIN_KEY, wxString>

Definition at line 64 of file test_net_chain_resolve_terminals.cpp.

◆ TERM_PAIR

using TERM_PAIR = std::pair<REF_PIN_KEY, REF_PIN_KEY>

Definition at line 65 of file test_net_chain_resolve_terminals.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/5]

BOOST_AUTO_TEST_CASE ( PicksChainContainingBothTerminalNets )

◆ BOOST_AUTO_TEST_CASE() [2/5]

BOOST_AUTO_TEST_CASE ( ResolvesWhenOneEndpointIsUnnamedSyntheticName )

◆ BOOST_AUTO_TEST_CASE() [3/5]

BOOST_AUTO_TEST_CASE ( ReturnsNullWhenEitherTerminalUnresolvable )

◆ BOOST_AUTO_TEST_CASE() [4/5]

BOOST_AUTO_TEST_CASE ( ReturnsNullWhenNoPotentialSpansBothEndpoints )

◆ BOOST_AUTO_TEST_CASE() [5/5]

BOOST_AUTO_TEST_CASE ( SwappedTerminalOrderStillResolves )

◆ boost_test_resolve_potential_chain_by_terminals()

SCH_NETCHAIN * boost_test_resolve_potential_chain_by_terminals ( const std::pair< std::pair< wxString, wxString >, std::pair< wxString, wxString > > & aTerms,
const std::map< std::pair< wxString, wxString >, wxString > & aRefPinToNet,
const std::vector< std::unique_ptr< SCH_NETCHAIN > > & aPotentials,
const wxString & aChainName )

◆ makePotential()

static std::unique_ptr< SCH_NETCHAIN > makePotential ( const wxString & aName,
std::initializer_list< wxString > aNets )
static