|
KiCad PCB EDA Suite
|
Regression test for issue #24340: false annular-width DRC violations on PTH pads that partially overlap a same-number SMD pad. More...
#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 <base_units.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_ANNULAR_OVERLAP_FIXTURE |
Functions | |
| BOOST_FIXTURE_TEST_CASE (AnnularOverlapIssue24340, DRC_ANNULAR_OVERLAP_FIXTURE) | |
Regression test for issue #24340: false annular-width DRC violations on PTH pads that partially overlap a same-number SMD pad.
The bbox overlap forces the polygon path in DRC_TEST_PROVIDER_ANNULAR_WIDTH, which polygonised the THT pad with ERROR_INSIDE. The inscribed-polygon outline lies ~maxError (5 µm default) inside the true circle, so DRC reported ~0.1484 mm and flagged a violation that does not exist in the true geometry.
Fixture (qa/data/pcbnew/issue24340/) – two modified R_0805 footprints, each with same-number THT + SMD overlap, sharing the same project rule min_via_annular_width = 0.1524 mm:
Bug-case footprint at board (130, 95.5): THT circle size 0.508 mm, drill 0.2032 mm – exact annular 0.1524 mm (equal to the constraint). Pre-fix: polygon path with ERROR_INSIDE under-reports the annular and falsely flags a violation. Post-fix: fast path is used, reports 0.1524 mm, passes.
Control footprint at board (176, 95.5): THT circle size 0.4 mm, drill 0.2 mm – annular 0.1 mm, well below the 0.1524 mm constraint. A genuine violation that the fix must still report (guards against accidentally suppressing real failures).
Expected: exactly 1 annular_width violation, on the control footprint.
Definition in file test_drc_annular_overlap_issue24340.cpp.
| BOOST_FIXTURE_TEST_CASE | ( | AnnularOverlapIssue24340 | , |
| DRC_ANNULAR_OVERLAP_FIXTURE | ) |
Definition at line 87 of file test_drc_annular_overlap_issue24340.cpp.
References std::abs(), BOOST_CHECK_EQUAL(), BOOST_TEST_MESSAGE(), DRC_ENGINE::ClearViolationHandler(), DRCE_ANNULAR_WIDTH, DRCE_FIRST, DRCE_LAST, KI_TEST::LoadBoard(), BOARD_DESIGN_SETTINGS::m_DRCEngine, BOARD_DESIGN_SETTINGS::m_DRCSeverities, MM, pcbIUScale, RPT_SEVERITY_ERROR, RPT_SEVERITY_IGNORE, DRC_ENGINE::RunTests(), DRC_ENGINE::SetViolationHandler(), VECTOR2< T >::x, and VECTOR2< T >::y.