From ea3efac2b6fbac91879cba8eb771659b1429a965 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 12 Jan 2022 14:41:11 +0100 Subject: [PATCH] drc/drc_test_provider_library_parity.cpp: protect against null pointer use. qa tests, test_solder_mask_bridging.cpp: filter not relevant DRC tests --- .../drc/drc_test_provider_library_parity.cpp | 2 +- qa/pcbnew/drc/test_drc_regressions.cpp | 19 +++++++++++-------- qa/pcbnew/drc/test_solder_mask_bridging.cpp | 6 ++++++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/pcbnew/drc/drc_test_provider_library_parity.cpp b/pcbnew/drc/drc_test_provider_library_parity.cpp index 1f19f6f8d5..908f5d9ed0 100644 --- a/pcbnew/drc/drc_test_provider_library_parity.cpp +++ b/pcbnew/drc/drc_test_provider_library_parity.cpp @@ -499,7 +499,7 @@ bool DRC_TEST_PROVIDER_LIBRARY_PARITY::Run() drcItem->SetItems( footprint ); reportViolation( drcItem, footprint->GetCenter(), UNDEFINED_LAYER ); } - else if( footprint->FootprintNeedsUpdate( libFootprint.get() ) + else if( libFootprint && footprint->FootprintNeedsUpdate( libFootprint.get() ) && !m_drcEngine->IsErrorLimitExceeded( DRCE_LIB_FOOTPRINT_MISMATCH )) { std::shared_ptr drcItem = DRC_ITEM::Create( DRCE_LIB_FOOTPRINT_MISMATCH ); diff --git a/qa/pcbnew/drc/test_drc_regressions.cpp b/qa/pcbnew/drc/test_drc_regressions.cpp index 17f0925576..78d5df6b39 100644 --- a/qa/pcbnew/drc/test_drc_regressions.cpp +++ b/qa/pcbnew/drc/test_drc_regressions.cpp @@ -48,14 +48,17 @@ BOOST_FIXTURE_TEST_CASE( DRCFalsePositiveRegressions, DRC_REGRESSION_TEST_FIXTUR { // These documents at one time flagged DRC errors that they shouldn't have. - std::vector tests = { "issue4139", - "issue4774", - "issue5978", - "issue5990", - "issue6443", - "issue7567", - "issue7975", - "issue8407" }; + std::vector tests = { "issue4139", // DRC fails wrongly with minimally-spaced pads at 45 degree + "issue4774", // Shape collisions missing SH_POLY_SET - Breaks DRC + "issue5978", // Hole clearance violation with non-copper pad + "issue5990", // DRC flags a board edge clearance violation + // although the clearance is respected + "issue6443", // Wrong DRC and rendering of THT pads with + // selective inner copper layers + "issue7567", // DRC constraint to disallow holes gets SMD pads also + "issue7975", // Differential pair gap out of range fault by DRC + "issue8407" // PCBNEW: Arc for diff pair has clearance DRC error + }; for( const wxString& relPath : tests ) { diff --git a/qa/pcbnew/drc/test_solder_mask_bridging.cpp b/qa/pcbnew/drc/test_solder_mask_bridging.cpp index 225806c05a..0dfd38ea95 100644 --- a/qa/pcbnew/drc/test_solder_mask_bridging.cpp +++ b/qa/pcbnew/drc/test_solder_mask_bridging.cpp @@ -49,6 +49,12 @@ BOOST_FIXTURE_TEST_CASE( DRCSolderMaskBridgingTest, DRC_REGRESSION_TEST_FIXTURE std::vector violations; BOARD_DESIGN_SETTINGS& bds = m_board->GetDesignSettings(); + // Disable some DRC tests not useful in this testcase (and time consuming) + bds.m_DRCSeverities[ DRCE_LIB_FOOTPRINT_ISSUES ] = SEVERITY::RPT_SEVERITY_IGNORE; + bds.m_DRCSeverities[ DRCE_LIB_FOOTPRINT_MISMATCH ] = SEVERITY::RPT_SEVERITY_IGNORE; + bds.m_DRCSeverities[ DRCE_COPPER_SLIVER ] = SEVERITY::RPT_SEVERITY_IGNORE; + bds.m_DRCSeverities[ DRCE_STARVED_THERMAL ] = SEVERITY::RPT_SEVERITY_IGNORE; + bds.m_DRCEngine->SetViolationHandler( [&]( const std::shared_ptr& aItem, VECTOR2I aPos, PCB_LAYER_ID aLayer ) {