|
KiCad PCB EDA Suite
|
Regression test for issue #24541: DRC silently ignores NPTH (oval) slots in the hole-to-hole clearance test, so two overlapping NPTH slots produce no violation even though the project sets hole-to-hole = error. More...
#include <algorithm>#include <set>#include <utility>#include <qa_utils/wx_utils/unit_test_utils.h>#include <pcbnew_utils/board_test_utils.h>#include <board.h>#include <board_design_settings.h>#include <footprint.h>#include <pad.h>#include <drc/drc_item.h>#include <drc/drc_engine.h>#include <settings/settings_manager.h>#include <widgets/report_severity.h>Go to the source code of this file.
Classes | |
| struct | DRC_HOLE_TO_HOLE_NPTH_SLOT_FIXTURE |
Functions | |
| BOOST_FIXTURE_TEST_CASE (HoleToHoleNpthSlotIssue24541, DRC_HOLE_TO_HOLE_NPTH_SLOT_FIXTURE) | |
Regression test for issue #24541: DRC silently ignores NPTH (oval) slots in the hole-to-hole clearance test, so two overlapping NPTH slots produce no violation even though the project sets hole-to-hole = error.
DRC_TEST_PROVIDER_HOLE_TO_HOLE only inserts a pad into its hole r-tree when the drill is round (drill.x == drill.y) and only queries pads for which PAD::HasDrilledHole() is true. Oval slots fail both gates, so a slot is never tested against any other hole. The provider's stated rationale is "slots are milled after drilling", but that does not exempt a slot from the mutual hole-to-hole clearance against other slots / drilled holes.
Fixture (qa/data/pcbnew/issue24541) is the reporter's project: two footprints, each carrying a 10 mm x 1 mm NPTH oval slot, placed so the slots overlap. min_hole_to_hole = 0.25 mm, hole_to_hole severity = error.
Expected (correct) behavior: at least one DRCE_DRILLED_HOLES_TOO_CLOSE violation between the two overlapping slots.
Pre-fix: 0 violations (slots skipped entirely).
This test documents the reproduction; it is expected to FAIL on the buggy code and PASS once slots participate in the hole-to-hole check.
Definition in file test_drc_hole_to_hole_npth_slot_issue24541.cpp.
| BOOST_FIXTURE_TEST_CASE | ( | HoleToHoleNpthSlotIssue24541 | , |
| DRC_HOLE_TO_HOLE_NPTH_SLOT_FIXTURE | ) |
Definition at line 85 of file test_drc_hole_to_hole_npth_slot_issue24541.cpp.
References BOOST_CHECK_EQUAL(), BOOST_TEST_MESSAGE(), DRC_ENGINE::ClearViolationHandler(), DRCE_DRILLED_HOLES_COLOCATED, DRCE_DRILLED_HOLES_TOO_CLOSE, DRCE_FIRST, DRCE_LAST, KI_TEST::LoadBoard(), BOARD_DESIGN_SETTINGS::m_DRCEngine, BOARD_DESIGN_SETTINGS::m_DRCSeverities, EDA_ITEM::m_Uuid, MM, NPTH, pad, RPT_SEVERITY_ERROR, RPT_SEVERITY_IGNORE, DRC_ENGINE::RunTests(), and DRC_ENGINE::SetViolationHandler().