21#include <boost/test/unit_test.hpp>
56constexpr double EPS_IU = 1.0;
57constexpr int PAD_SIZE_NM = 500'000;
65 pad->SetPosition( aPos );
72NETINFO_ITEM* addNet(
BOARD* aBoard,
const wxString& aName,
int aCode,
const wxString& aChain )
92long long tunerBridging(
BOARD* aBoard,
const wxString& aChain )
110 NETINFO_ITEM* netA = addNet( &board, wxS(
"/A" ), 1, wxS(
"SIG" ) );
111 NETINFO_ITEM* netB = addNet( &board, wxS(
"/B" ), 2, wxS(
"SIG" ) );
114 addPad( fp, netA,
VECTOR2I( -1'000'000, 0 ) );
115 addPad( fp, netB,
VECTOR2I( 1'000'000, 0 ) );
118 long long tunerLen = tunerBridging( &board, wxS(
"SIG" ) );
120 BOOST_CHECK_CLOSE( drcLen, 2'000'000.0, 0.001 );
121 BOOST_CHECK_LE(
std::abs( drcLen -
static_cast<double>( tunerLen ) ), EPS_IU );
132 NETINFO_ITEM* netA = addNet( &board, wxS(
"/A" ), 1, wxS(
"SIG" ) );
133 NETINFO_ITEM* netB = addNet( &board, wxS(
"/B" ), 2, wxS(
"SIG" ) );
136 addPad( fp, netA,
VECTOR2I( -2'500'000, 0 ) );
137 addPad( fp, netA,
VECTOR2I( 0, 0 ) );
138 addPad( fp, netB,
VECTOR2I( 2'500'000, 0 ) );
141 long long tunerLen = tunerBridging( &board, wxS(
"SIG" ) );
144 BOOST_CHECK_CLOSE( drcLen, 5'000'000.0, 0.001 );
145 BOOST_CHECK_LE(
std::abs( drcLen -
static_cast<double>( tunerLen ) ), EPS_IU );
156 NETINFO_ITEM* netA = addNet( &board, wxS(
"/A" ), 1, wxS(
"SIG" ) );
157 NETINFO_ITEM* netB = addNet( &board, wxS(
"/B" ), 2, wxS(
"SIG" ) );
158 NETINFO_ITEM* netC = addNet( &board, wxS(
"/C" ), 3, wxS(
"SIG" ) );
161 addPad( fp, netA,
VECTOR2I( -2'500'000, 0 ) );
162 addPad( fp, netB,
VECTOR2I( 0, 0 ) );
163 addPad( fp, netC,
VECTOR2I( 2'500'000, 0 ) );
166 long long tunerLen = tunerBridging( &board, wxS(
"SIG" ) );
170 BOOST_CHECK_CLOSE( drcLen, 5'000'000.0, 0.001 );
171 BOOST_CHECK_GT( tunerLen, 0 );
172 BOOST_CHECK_LE(
std::abs( drcLen -
static_cast<double>( tunerLen ) ), EPS_IU );
183 NETINFO_ITEM* netA = addNet( &board, wxS(
"/A" ), 1, wxS(
"SIG" ) );
184 NETINFO_ITEM* netB = addNet( &board, wxS(
"/B" ), 2, wxS(
"SIG" ) );
187 addPad( fp, netA,
VECTOR2I( -3'000'000, 0 ) );
188 addPad( fp, netA,
VECTOR2I( -1'000'000, 0 ) );
189 addPad( fp, netB,
VECTOR2I( 1'000'000, 0 ) );
190 addPad( fp, netB,
VECTOR2I( 3'000'000, 0 ) );
193 long long tunerLen = tunerBridging( &board, wxS(
"SIG" ) );
195 BOOST_CHECK_CLOSE( drcLen, 6'000'000.0, 0.001 );
196 BOOST_CHECK_LE(
std::abs( drcLen -
static_cast<double>( tunerLen ) ), EPS_IU );
206 NETINFO_ITEM* netA = addNet( &board, wxS(
"/A" ), 1, wxS(
"SIG" ) );
209 addPad( fp, netA,
VECTOR2I( -2'000'000, 0 ) );
210 addPad( fp, netA,
VECTOR2I( 0, 0 ) );
211 addPad( fp, netA,
VECTOR2I( 2'000'000, 0 ) );
214 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