58 std::vector<DRC_ITEM> edgeViolations;
59 std::vector<DRC_ITEM> holeViolations;
70 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I&,
int,
74 edgeViolations.push_back( *aItem );
76 holeViolations.push_back( *aItem );
81 std::map<KIID, EDA_ITEM*> itemMap;
82 m_board->FillItemMap( itemMap );
87 auto countViolationsForRef =
88 [&](
const std::vector<DRC_ITEM>& aViolations,
const wxString& aRef,
bool aRequireBothItems )
92 for(
const DRC_ITEM& item : aViolations )
96 for(
KIID uuid : { item.GetMainItemID(), item.GetAuxItemID() } )
101 auto it = itemMap.find( uuid );
103 if( it == itemMap.end() )
117 if( aRequireBothItems ? hits >= 2 : hits > 0 )
128 BOOST_REQUIRE_GT( countViolationsForRef( edgeViolations, wxString(
"SW1" ),
false ), 0 );
132 BOOST_CHECK_EQUAL( countViolationsForRef( edgeViolations, wxString(
"J1" ),
false ), 0 );
137 BOOST_CHECK_EQUAL( countViolationsForRef( holeViolations, wxString(
"J1" ),
true ), 0 );
139 if( countViolationsForRef( edgeViolations, wxString(
"J1" ),
false ) != 0
140 || countViolationsForRef( holeViolations, wxString(
"J1" ),
true ) != 0 )
144 for(
const DRC_ITEM& item : edgeViolations )
147 for(
const DRC_ITEM& item : holeViolations )
BOOST_CHECK_EQUAL(result, "25.4")