62 std::vector<DRC_ITEM> edgeViolations;
63 std::vector<DRC_ITEM> holeViolations;
74 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I&,
int,
78 edgeViolations.push_back( *aItem );
80 holeViolations.push_back( *aItem );
85 std::map<KIID, EDA_ITEM*> itemMap;
86 m_board->FillItemMap( itemMap );
91 auto countViolationsForRef =
92 [&](
const std::vector<DRC_ITEM>& aViolations,
const wxString& aRef,
bool aRequireBothItems )
96 for(
const DRC_ITEM& item : aViolations )
100 for(
KIID uuid : { item.GetMainItemID(), item.GetAuxItemID() } )
105 auto it = itemMap.find( uuid );
107 if( it == itemMap.end() )
121 if( aRequireBothItems ? hits >= 2 : hits > 0 )
132 BOOST_REQUIRE_GT( countViolationsForRef( edgeViolations, wxString(
"SW1" ),
false ), 0 );
136 BOOST_CHECK_EQUAL( countViolationsForRef( edgeViolations, wxString(
"J1" ),
false ), 0 );
141 BOOST_CHECK_EQUAL( countViolationsForRef( holeViolations, wxString(
"J1" ),
true ), 0 );
143 if( countViolationsForRef( edgeViolations, wxString(
"J1" ),
false ) != 0
144 || countViolationsForRef( holeViolations, wxString(
"J1" ),
true ) != 0 )
148 for(
const DRC_ITEM& item : edgeViolations )
151 for(
const DRC_ITEM& item : holeViolations )
BOOST_CHECK_EQUAL(result, "25.4")