20#include <boost/test/unit_test.hpp>
35static const char*
DAISY_PCB_FILE =
"net_chains/chain_length_daisy.kicad_pcb";
45std::unique_ptr<BOARD> loadBoard(
const char* aBoardFile )
49 board->BuildConnectivity();
55void tagAndSetTerminals(
BOARD* aBoard,
const wxString& aChain )
59 if( n && n->GetNetname().StartsWith( wxS(
"/NET_" ) ) )
60 n->SetNetChain( aChain );
68 if( fp->Pads().empty() )
84 if( n && n->GetNetChain() == aChain )
86 n->SetTerminalPad( 0, first->
Pads().front() );
87 n->SetTerminalPad( 1, last->
Pads().front() );
101 tagAndSetTerminals( board.get(), wxS(
"DSY" ) );
103 std::set<BOARD_CONNECTED_ITEM*> items;
107 if( t->GetNet() && t->GetNet()->GetNetChain() == wxS(
"DSY" ) )
111 for(
FOOTPRINT* fp : board->Footprints() )
113 for(
PAD* p : fp->Pads() )
115 if( p->GetNet() && p->GetNet()->GetNetChain() == wxS(
"DSY" ) )
123 BOOST_CHECK_CLOSE( topo.
TrunkLength(), 50.0e6, 5.0 );
130 tagAndSetTerminals( board.get(), wxS(
"BR" ) );
132 std::set<BOARD_CONNECTED_ITEM*> items;
136 if( t->GetNet() && t->GetNet()->GetNetChain() == wxS(
"BR" ) )
140 for(
FOOTPRINT* fp : board->Footprints() )
142 for(
PAD* p : fp->Pads() )
144 if( p->GetNet() && p->GetNet()->GetNetChain() == wxS(
"BR" ) )
152 BOOST_CHECK_CLOSE( topo.
TrunkLength(), 50.0e6, 5.0 );
General utilities for PCB file IO for QA programs.
Information pertinent to a Pcbnew printed circuit board.
const NETINFO_LIST & GetNetInfo() const
const FOOTPRINTS & Footprints() const
Build a topological view of a single named net chain's routed copper.
const std::vector< STUB > & Stubs() const
double TrunkLength() const
Handle the data for a net.
A #PLUGIN derivation for saving and loading Pcbnew s-expression formatted files.
std::unique_ptr< BOARD > LoadBoard(const wxString &aFileName, const std::map< std::string, UTF8 > *aProperties=nullptr, PROJECT *aProject=nullptr)
Load information from some input file format that this PCB_IO implementation knows about into new BOA...
std::string GetPcbnewTestDataDir()
Utility which returns a path to the data directory where the test board files are stored.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_CASE(DaisyChainTrunkEqualsSumExplicit)
static const char * BRANCHED_PCB_FILE
static const char * DAISY_PCB_FILE
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL(result, "25.4")