20#include <boost/test/unit_test.hpp>
37 m_board = std::make_unique<BOARD>();
69 auto items = m_board->AllConnectedItems();
71 bool foundPad =
false;
72 bool foundShape =
false;
83 BOOST_CHECK_MESSAGE( foundPad,
"AllConnectedItems should include footprint pads" );
84 BOOST_CHECK_MESSAGE( foundShape,
"AllConnectedItems should include footprint copper shapes" );
104 auto items = m_board->AllConnectedItems();
106 bool foundZone =
false;
114 BOOST_CHECK_MESSAGE( foundZone,
"AllConnectedItems should include footprint zones" );
126 std::unique_ptr<BOARD> srcBoard = std::make_unique<BOARD>();
129 srcBoard->Add( srcNet );
137 pad->SetNet( srcNet );
149 m_board->Add( destNet );
152 srcBoard->MapNets( m_board.get() );
155 BOOST_CHECK_MESSAGE(
pad->GetNet() != srcNet,
156 "Pad net should be remapped away from source net" );
157 BOOST_CHECK_MESSAGE( shape->
GetNet() != srcNet,
158 "Footprint shape net should be remapped away from source net" );
159 BOOST_CHECK(
pad->GetNetname() == wxT(
"TestNet" ) );
160 BOOST_CHECK( shape->
GetNetname() == wxT(
"TestNet" ) );
174 std::unique_ptr<BOARD> srcBoard = std::make_unique<BOARD>();
177 srcBoard->Add( srcNet );
186 pad->SetNet( srcNet );
197 srcBoard->MapNets( m_board.get() );
200 srcBoard->Remove( fp );
216 std::string output = formatter.
GetString();
217 BOOST_CHECK_MESSAGE( output.find(
"GND" ) != std::string::npos,
218 "Formatted footprint should contain the remapped net name" );
constexpr EDA_IU_SCALE pcbIUScale
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
wxString GetNetname() const
NETINFO_ITEM * GetNet() const
Return #NET_INFO object for a given item.
void SetNet(NETINFO_ITEM *aNetInfo)
Set a NET_INFO object for the 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)
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 void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
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()
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()
VECTOR2< int32_t > VECTOR2I