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 )
108 BOARD_ITEM* item_a = m_board->GetItem( aItem->GetMainItemID() );
109 PAD* pad_a = dynamic_cast<PAD*>( item_a );
110 PCB_TRACK* trk_a = dynamic_cast<PCB_TRACK*>( item_a );
112 BOARD_ITEM* item_b = m_board->GetItem( aItem->GetAuxItemID() );
113 PAD* pad_b = dynamic_cast<PAD*>( item_b );
114 PCB_TRACK* trk_b = dynamic_cast<PCB_TRACK*>( item_b );
116 if( pad_a && pad_a->GetNumber() ==
"2" ) foundPad2Error = true;
117 else if( pad_a && pad_a->GetNumber() ==
"4" ) foundPad4Error = true;
118 else if( pad_a && pad_a->GetNumber() ==
"6" ) foundPad6Error = true;
119 else if( pad_b && pad_b->GetNumber() ==
"2" ) foundPad2Error = true;
120 else if( pad_b && pad_b->GetNumber() ==
"4" ) foundPad4Error = true;
121 else if( pad_b && pad_b->GetNumber() ==
"6" ) foundPad6Error = true;
122 else if( trk_a && trk_a->m_Uuid == arc8 ) foundArc8Error = true;
123 else if( trk_a && trk_a->m_Uuid == arc12 ) foundArc12Error = true;
124 else if( trk_b && trk_b->m_Uuid == arc8 ) foundArc8Error = true;
125 else if( trk_b && trk_b->m_Uuid == arc12 ) foundArc12Error = true;
126 else foundOtherError = true;
132 BOOST_CHECK_EQUAL( foundPad2Error,
true );
133 BOOST_CHECK_EQUAL( foundPad4Error,
true );
134 BOOST_CHECK_EQUAL( foundPad6Error,
true );
135 BOOST_CHECK_EQUAL( foundArc8Error,
true );
136 BOOST_CHECK_EQUAL( foundArc12Error,
true );
137 BOOST_CHECK_EQUAL( foundOtherError,
false );
155 for(
ZONE* zone : m_board->Zones() )
157 if( zone->GetLayerSet().Contains(
F_Cu ) )
170 std::vector<wxString> tests = {
"issue18",
186 for(
const wxString& relPath : tests )
194 std::vector<DRC_ITEM> violations;
197 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
VECTOR2I aPos,
int aLayer )
200 violations.push_back( *aItem );
205 if( violations.empty() )
207 BOOST_CHECK_EQUAL( 1, 1 );
208 BOOST_TEST_MESSAGE( (
const char*)(wxString::Format(
"Zone fill regression: %s passed", relPath ).utf8_str()) );
214 std::map<KIID, EDA_ITEM*> itemMap;
215 m_board->FillItemMap( itemMap );
217 for(
const DRC_ITEM& item : violations )
223 BOOST_ERROR( (
const char*)(wxString::Format(
"Zone fill regression: %s failed", relPath ).utf8_str()) );
231 std::vector<wxString> tests = {
"issue16182"
234 for(
const wxString& relPath : tests )
242 std::vector<DRC_ITEM> violations;
245 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
VECTOR2I aPos,
int aLayer )
248 violations.push_back( *aItem );
253 if( violations.empty() )
255 BOOST_CHECK_EQUAL( 1, 1 );
256 BOOST_TEST_MESSAGE( (
const char*)(wxString::Format(
"Zone fill copper sliver regression: %s passed", relPath ).utf8_str()) );
262 std::map<KIID, EDA_ITEM*> itemMap;
263 m_board->FillItemMap( itemMap );
265 for(
const DRC_ITEM& item : violations )
271 BOOST_ERROR( (
const char*)(wxString::Format(
"Zone fill copper sliver regression: %s failed", relPath ).utf8_str()) );
280 std::vector<std::pair<wxString,int>> tests = { {
"teardrop_issue_JPC2", 5 }
283 for(
auto& [ relPath, count ] : tests )
293 for(
ZONE* zone : m_board->Zones() )
295 if( zone->IsTeardropArea() )
299 BOOST_CHECK_MESSAGE( zoneCount == count,
"Expected " << count <<
" teardrop zones in "
300 << 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, POLYGON_MODE aFastMode)
Perform boolean polyset union For aFastMode meaning, see function booleanOp.
int OutlineCount() const
Return the number of outlines in the set.
Handle a list of polygons defining a copper zone.
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