71 m_board->GetDesignSettings().m_DRCEngine->ClearViolationHandler();
89 BOOST_REQUIRE_MESSAGE( m_board,
"Failed to load board issue24541" );
90 BOOST_REQUIRE_EQUAL( m_board->Footprints().size(), 2 );
95 int npthSlotCount = 0;
97 for(
FOOTPRINT* fp : m_board->Footprints() )
99 for(
PAD*
pad : fp->Pads() )
102 &&
pad->GetDrillSize().x !=
pad->GetDrillSize().y )
109 BOOST_REQUIRE_MESSAGE( npthSlotCount == 2,
110 "Fixture changed: expected two NPTH oval slots." );
114 BOOST_REQUIRE_MESSAGE( bds.
m_DRCEngine,
"DRC engine not initialized" );
125 int holeToHoleCount = 0;
126 std::set<std::pair<KIID, KIID>> npthSlotPairs;
131 const PAD*
pad =
dynamic_cast<const PAD*
>( aItem );
134 &&
pad->GetDrillSize().x !=
pad->GetDrillSize().y;
138 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I& ,
int ,
141 int code = aItem->GetErrorCode();
148 BOARD_ITEM* itemA = m_board->ResolveItem( aItem->GetMainItemID(),
true );
149 BOARD_ITEM* itemB = m_board->ResolveItem( aItem->GetAuxItemID(),
true );
151 if( isNpthSlot( itemA ) && isNpthSlot( itemB ) )
152 npthSlotPairs.emplace( std::minmax( itemA->
m_Uuid, itemB->
m_Uuid ) );
159 BOOST_TEST_MESSAGE( wxString::Format(
"Hole-to-hole violations: %d; NPTH slot pairs: %d",
160 holeToHoleCount, (
int) npthSlotPairs.size() ) );
Container for design settings for a BOARD object.
std::map< int, SEVERITY > m_DRCSeverities
std::shared_ptr< DRC_ENGINE > m_DRCEngine
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
void RunTests(EDA_UNITS aUnits, bool aReportAllTrackErrors, bool aTestFootprints, BOARD_COMMIT *aCommit=nullptr)
Run the DRC tests.
void SetViolationHandler(DRC_VIOLATION_HANDLER aHandler)
Set an optional DRC violation handler (receives DRC_ITEMs and positions).
void ClearViolationHandler()
@ DRCE_DRILLED_HOLES_TOO_CLOSE
@ DRCE_DRILLED_HOLES_COLOCATED
void LoadBoard(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< BOARD > &aBoard)
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
SETTINGS_MANAGER m_settingsManager
~DRC_HOLE_TO_HOLE_NPTH_SLOT_FIXTURE()
DRC_HOLE_TO_HOLE_NPTH_SLOT_FIXTURE()=default
std::unique_ptr< BOARD > m_board
BOOST_FIXTURE_TEST_CASE(HoleToHoleNpthSlotIssue24541, DRC_HOLE_TO_HOLE_NPTH_SLOT_FIXTURE)
BOOST_TEST_MESSAGE("\n=== Real-World Polygon PIP Benchmark ===\n"<< formatTable(table))
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I