62 for(
PAD*
pad : m_board->Footprints()[0]->Pads() )
64 if(
pad->GetNumber() ==
"2" ||
pad->GetNumber() ==
"4" ||
pad->GetNumber() ==
"6" )
75 for(
PCB_TRACK* track : m_board->Tracks() )
84 track->SetWidth( track->GetWidth() +
delta +
delta );
88 arc12 = track->m_Uuid;
94 bool foundPad2Error =
false;
95 bool foundPad4Error =
false;
96 bool foundPad6Error =
false;
97 bool foundArc8Error =
false;
98 bool foundArc12Error =
false;
99 bool foundOtherError =
false;
104 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
VECTOR2I aPos,
int aLayer,
109 BOARD_ITEM* item_a = m_board->GetItem( aItem->GetMainItemID() );
110 PAD* pad_a = dynamic_cast<PAD*>( item_a );
111 PCB_TRACK* trk_a = dynamic_cast<PCB_TRACK*>( item_a );
113 BOARD_ITEM* item_b = m_board->GetItem( aItem->GetAuxItemID() );
114 PAD* pad_b = dynamic_cast<PAD*>( item_b );
115 PCB_TRACK* trk_b = dynamic_cast<PCB_TRACK*>( item_b );
117 if( pad_a && pad_a->GetNumber() ==
"2" ) foundPad2Error = true;
118 else if( pad_a && pad_a->GetNumber() ==
"4" ) foundPad4Error = true;
119 else if( pad_a && pad_a->GetNumber() ==
"6" ) foundPad6Error = true;
120 else if( pad_b && pad_b->GetNumber() ==
"2" ) foundPad2Error = true;
121 else if( pad_b && pad_b->GetNumber() ==
"4" ) foundPad4Error = true;
122 else if( pad_b && pad_b->GetNumber() ==
"6" ) foundPad6Error = true;
123 else if( trk_a && trk_a->m_Uuid == arc8 ) foundArc8Error = true;
124 else if( trk_a && trk_a->m_Uuid == arc12 ) foundArc12Error = true;
125 else if( trk_b && trk_b->m_Uuid == arc8 ) foundArc8Error = true;
126 else if( trk_b && trk_b->m_Uuid == arc12 ) foundArc12Error = true;
127 else foundOtherError = true;
134 BOOST_CHECK_EQUAL( foundPad2Error,
true );
135 BOOST_CHECK_EQUAL( foundPad4Error,
true );
136 BOOST_CHECK_EQUAL( foundPad6Error,
true );
137 BOOST_CHECK_EQUAL( foundArc8Error,
true );
138 BOOST_CHECK_EQUAL( foundArc12Error,
true );
139 BOOST_CHECK_EQUAL( foundOtherError,
false );
157 for(
ZONE* zone : m_board->Zones() )
159 if( zone->GetLayerSet().Contains(
F_Cu ) )
171 std::vector<wxString> tests = {
"issue18",
187 for(
const wxString& relPath : tests )
195 std::vector<DRC_ITEM> violations;
198 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
VECTOR2I aPos,
int aLayer,
202 violations.push_back( *aItem );
207 if( violations.empty() )
209 BOOST_CHECK_EQUAL( 1, 1 );
210 BOOST_TEST_MESSAGE( (
const char*)(wxString::Format(
"Zone fill regression: %s passed", relPath ).utf8_str()) );
216 std::map<KIID, EDA_ITEM*> itemMap;
217 m_board->FillItemMap( itemMap );
219 for(
const DRC_ITEM& item : violations )
225 BOOST_ERROR( (
const char*)(wxString::Format(
"Zone fill regression: %s failed", relPath ).utf8_str()) );
233 std::vector<wxString> tests = {
"issue16182"
236 for(
const wxString& relPath : tests )
244 std::vector<DRC_ITEM> violations;
247 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
VECTOR2I aPos,
int aLayer,
251 violations.push_back( *aItem );
256 if( violations.empty() )
258 BOOST_CHECK_EQUAL( 1, 1 );
259 BOOST_TEST_MESSAGE( (
const char*)(wxString::Format(
"Zone fill copper sliver regression: %s passed", relPath ).utf8_str()) );
265 std::map<KIID, EDA_ITEM*> itemMap;
266 m_board->FillItemMap( itemMap );
268 for(
const DRC_ITEM& item : violations )
274 BOOST_ERROR( (
const char*)(wxString::Format(
"Zone fill copper sliver regression: %s failed", relPath ).utf8_str()) );
283 std::vector<std::pair<wxString,int>> tests = { {
"teardrop_issue_JPC2", 5 }
286 for(
auto& [ relPath, count ] : tests )
296 for(
ZONE* zone : m_board->Zones() )
298 if( zone->IsTeardropArea() )
302 BOOST_CHECK_MESSAGE( zoneCount == count,
"Expected " << count <<
" teardrop zones in "
303 << relPath <<
", found "
constexpr EDA_IU_SCALE pcbIUScale
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Container for design settings for a BOARD object.
std::shared_ptr< DRC_ENGINE > m_DRCEngine
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
Represent a set of closed polygons.
void BooleanAdd(const SHAPE_POLY_SET &b)
Perform boolean polyset union.
int OutlineCount() const
Return the number of outlines in the set.
Handle a list of polygons defining a copper zone.
std::function< void(PCB_MARKER *aMarker)> DRC_CUSTOM_MARKER_HANDLER
void LoadBoard(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< BOARD > &aBoard)
void FillZones(BOARD *m_board)
std::unique_ptr< BOARD > m_board
SETTINGS_MANAGER m_settingsManager
BOOST_FIXTURE_TEST_CASE(BasicZoneFills, ZONE_FILL_TEST_FIXTURE)
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
VECTOR2< int32_t > VECTOR2I