Fix diff pair coupling test when gap constraint is in a different rule

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8519
This commit is contained in:
Jon Evans 2021-05-31 10:12:50 -04:00
parent c4cabb38d5
commit 6381ffd10a
1 changed files with 11 additions and 5 deletions

View File

@ -410,19 +410,25 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run()
{
auto val = gapConstraint->GetValue();
bool insideRange = true;
if ( val.HasMin() && gap < val.Min() )
if( val.HasMin() && gap < val.Min() )
insideRange = false;
if ( val.HasMax() && gap > val.Max() )
if( val.HasMax() && gap > val.Max() )
insideRange = false;
// if(val.HasMin() && val.HasMax() )
// drc_dbg(10, "Vmin %d vmax %d\n", val.Min(), val.Max() );
cpair.couplingOK = insideRange;
if( insideRange )
it.second.totalCoupled += length;
}
else
{
cpair.couplingOK = true;
}
if( cpair.couplingOK )
it.second.totalCoupled += length;
}
int totalLen = std::max( it.second.totalLengthN, it.second.totalLengthP );