20#include <boost/test/unit_test.hpp>
55constexpr double EPS_IU = 1.0;
56constexpr int PAD_SIZE_NM = 500'000;
64 pad->SetPosition( aPos );
71NETINFO_ITEM* addNet(
BOARD* aBoard,
const wxString& aName,
int aCode,
const wxString& aChain )
91long long tunerBridging(
BOARD* aBoard,
const wxString& aChain )
109 NETINFO_ITEM* netA = addNet( &board, wxS(
"/A" ), 1, wxS(
"SIG" ) );
110 NETINFO_ITEM* netB = addNet( &board, wxS(
"/B" ), 2, wxS(
"SIG" ) );
113 addPad( fp, netA,
VECTOR2I( -1'000'000, 0 ) );
114 addPad( fp, netB,
VECTOR2I( 1'000'000, 0 ) );
117 long long tunerLen = tunerBridging( &board, wxS(
"SIG" ) );
119 BOOST_CHECK_CLOSE( drcLen, 2'000'000.0, 0.001 );
120 BOOST_CHECK_LE(
std::abs( drcLen -
static_cast<double>( tunerLen ) ), EPS_IU );
131 NETINFO_ITEM* netA = addNet( &board, wxS(
"/A" ), 1, wxS(
"SIG" ) );
132 NETINFO_ITEM* netB = addNet( &board, wxS(
"/B" ), 2, wxS(
"SIG" ) );
135 addPad( fp, netA,
VECTOR2I( -2'500'000, 0 ) );
136 addPad( fp, netA,
VECTOR2I( 0, 0 ) );
137 addPad( fp, netB,
VECTOR2I( 2'500'000, 0 ) );
140 long long tunerLen = tunerBridging( &board, wxS(
"SIG" ) );
143 BOOST_CHECK_CLOSE( drcLen, 5'000'000.0, 0.001 );
144 BOOST_CHECK_LE(
std::abs( drcLen -
static_cast<double>( tunerLen ) ), EPS_IU );
155 NETINFO_ITEM* netA = addNet( &board, wxS(
"/A" ), 1, wxS(
"SIG" ) );
156 NETINFO_ITEM* netB = addNet( &board, wxS(
"/B" ), 2, wxS(
"SIG" ) );
157 NETINFO_ITEM* netC = addNet( &board, wxS(
"/C" ), 3, wxS(
"SIG" ) );
160 addPad( fp, netA,
VECTOR2I( -2'500'000, 0 ) );
161 addPad( fp, netB,
VECTOR2I( 0, 0 ) );
162 addPad( fp, netC,
VECTOR2I( 2'500'000, 0 ) );
165 long long tunerLen = tunerBridging( &board, wxS(
"SIG" ) );
169 BOOST_CHECK_CLOSE( drcLen, 5'000'000.0, 0.001 );
170 BOOST_CHECK_GT( tunerLen, 0 );
171 BOOST_CHECK_LE(
std::abs( drcLen -
static_cast<double>( tunerLen ) ), EPS_IU );
182 NETINFO_ITEM* netA = addNet( &board, wxS(
"/A" ), 1, wxS(
"SIG" ) );
183 NETINFO_ITEM* netB = addNet( &board, wxS(
"/B" ), 2, wxS(
"SIG" ) );
186 addPad( fp, netA,
VECTOR2I( -3'000'000, 0 ) );
187 addPad( fp, netA,
VECTOR2I( -1'000'000, 0 ) );
188 addPad( fp, netB,
VECTOR2I( 1'000'000, 0 ) );
189 addPad( fp, netB,
VECTOR2I( 3'000'000, 0 ) );
192 long long tunerLen = tunerBridging( &board, wxS(
"SIG" ) );
194 BOOST_CHECK_CLOSE( drcLen, 6'000'000.0, 0.001 );
195 BOOST_CHECK_LE(
std::abs( drcLen -
static_cast<double>( tunerLen ) ), EPS_IU );
205 NETINFO_ITEM* netA = addNet( &board, wxS(
"/A" ), 1, wxS(
"SIG" ) );
208 addPad( fp, netA,
VECTOR2I( -2'000'000, 0 ) );
209 addPad( fp, netA,
VECTOR2I( 0, 0 ) );
210 addPad( fp, netA,
VECTOR2I( 2'000'000, 0 ) );
213 long long tunerLen = tunerBridging( &board, wxS(
"SIG" ) );
Information pertinent to a Pcbnew printed circuit board.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Handle the data for a net.
void SetNetChain(const wxString &aNetChain)
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
long long GetCachedBridgingLength(BOARD *aBoard, const wxString &aNetChain, double *aDelayIUOut)
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
double BoardChainBridgingLength(const BOARD *aBoard, const wxString &aNetChain)
Sum chain bridging length across every footprint on the board.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_CASE(TwoPadTwoNetFootprintAgrees)
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I