20#include <boost/test/unit_test.hpp>
37 m_board = std::make_unique<BOARD>();
83 auto items = m_board->AllConnectedItems();
85 bool foundPad =
false;
86 bool foundShape =
false;
98 BOOST_CHECK_MESSAGE( foundShape,
"AllConnectedItems should include footprint copper shapes" );
118 auto items = m_board->AllConnectedItems();
120 bool foundZone =
false;
140 std::unique_ptr<BOARD> srcBoard = std::make_unique<BOARD>();
143 srcBoard->Add( srcNet );
151 pad->SetNet( srcNet );
163 m_board->Add( destNet );
166 srcBoard->MapNets( m_board.get() );
170 "Pad net should be remapped away from source net" );
172 "Footprint shape net should be remapped away from source net" );
173 BOOST_CHECK(
pad->GetNetname() == wxT(
"TestNet" ) );
174 BOOST_CHECK( shape->
GetNetname() == wxT(
"TestNet" ) );
188 std::unique_ptr<BOARD> srcBoard = std::make_unique<BOARD>();
191 srcBoard->Add( srcNet );
200 pad->SetNet( srcNet );
211 srcBoard->MapNets( m_board.get() );
214 srcBoard->Remove( fp );
232 "Formatted footprint should contain the remapped net name" );
249 ZONE* zone = MakeRectZone();
251 m_board->Add( zone );
270 ZONE* zone = MakeRectZone();
272 m_board->Add( zone );
277 BOOST_CHECK( zone->
GetNet() ==
nullptr );
291 ZONE* zone = MakeRectZone();
292 m_board->Add( zone );
306 ZONE* zone = MakeRectZone();
307 m_board->Add( zone );
310 BOOST_REQUIRE_EQUAL( zone->
GetLayerSet().count(), 3u );
322 ZONE* zone = MakeRectZone();
323 m_board->Add( zone );
325 BOOST_REQUIRE_EQUAL( zone->
GetLayerSet().count(), 1u );
342 ZONE* zone = MakeRectZone();
344 m_board->Add( zone );
constexpr EDA_IU_SCALE pcbIUScale
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
virtual bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
wxString GetNetname() const
virtual void SetNet(NETINFO_ITEM *aNetInfo)
Set a NET_INFO object for the item.
NETINFO_ITEM * GetNet() const
Return #NET_INFO object for a given item.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual void SetParent(EDA_ITEM *aParent)
void SetStart(const VECTOR2I &aStart)
void SetEnd(const VECTOR2I &aEnd)
LSET is a set of PCB_LAYER_IDs.
Handle the data for a net.
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
A #PLUGIN derivation for saving and loading Pcbnew s-expression formatted files.
void Format(const BOARD_ITEM *aItem) const
Output aItem to aFormatter in s-expression format.
void SetOutputFormatter(OUTPUTFORMATTER *aFormatter)
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
Handle a list of polygons defining a copper zone.
virtual PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
bool SetNetCode(int aNetCode, bool aNoAssert) override
Override that clamps the netcode to 0 when this zone is in copper-thieving fill mode.
void SetFillMode(ZONE_FILL_MODE aFillMode)
void SetLayerSet(const LSET &aLayerSet) override
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
bool AppendCorner(VECTOR2I aPosition, int aHoleIdx, bool aAllowDuplication=false)
Add a new corner to the zone outline (to the main outline or a hole)
BOARD_CONNECTED_ITEMS_FIXTURE()
ZONE * MakeRectZone()
Build a 5x5 mm rectangular zone on F_Cu owned by m_board.
std::unique_ptr< BOARD > m_board
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_CASE(AllConnectedItems_IncludesFootprintShapes)
Verify that AllConnectedItems includes copper shapes inside footprints.
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_MESSAGE(totalMismatches==0, std::to_string(totalMismatches)+" board(s) with strategy disagreements")
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I