drc/drc_test_provider_library_parity.cpp: protect against null pointer use.

qa tests, test_solder_mask_bridging.cpp: filter not relevant DRC tests
This commit is contained in:
jean-pierre charras 2022-01-12 14:41:11 +01:00
parent 9587a19b44
commit ea3efac2b6
3 changed files with 18 additions and 9 deletions

View File

@ -499,7 +499,7 @@ bool DRC_TEST_PROVIDER_LIBRARY_PARITY::Run()
drcItem->SetItems( footprint ); drcItem->SetItems( footprint );
reportViolation( drcItem, footprint->GetCenter(), UNDEFINED_LAYER ); 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 )) && !m_drcEngine->IsErrorLimitExceeded( DRCE_LIB_FOOTPRINT_MISMATCH ))
{ {
std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_LIB_FOOTPRINT_MISMATCH ); std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_LIB_FOOTPRINT_MISMATCH );

View File

@ -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. // These documents at one time flagged DRC errors that they shouldn't have.
std::vector<wxString> tests = { "issue4139", std::vector<wxString> tests = { "issue4139", // DRC fails wrongly with minimally-spaced pads at 45 degree
"issue4774", "issue4774", // Shape collisions missing SH_POLY_SET - Breaks DRC
"issue5978", "issue5978", // Hole clearance violation with non-copper pad
"issue5990", "issue5990", // DRC flags a board edge clearance violation
"issue6443", // although the clearance is respected
"issue7567", "issue6443", // Wrong DRC and rendering of THT pads with
"issue7975", // selective inner copper layers
"issue8407" }; "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 ) for( const wxString& relPath : tests )
{ {

View File

@ -49,6 +49,12 @@ BOOST_FIXTURE_TEST_CASE( DRCSolderMaskBridgingTest, DRC_REGRESSION_TEST_FIXTURE
std::vector<DRC_ITEM> violations; std::vector<DRC_ITEM> violations;
BOARD_DESIGN_SETTINGS& bds = m_board->GetDesignSettings(); 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( bds.m_DRCEngine->SetViolationHandler(
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, PCB_LAYER_ID aLayer ) [&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, PCB_LAYER_ID aLayer )
{ {