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,8 +410,10 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run()
{ {
auto val = gapConstraint->GetValue(); auto val = gapConstraint->GetValue();
bool insideRange = true; bool insideRange = true;
if( val.HasMin() && gap < val.Min() ) if( val.HasMin() && gap < val.Min() )
insideRange = false; insideRange = false;
if( val.HasMax() && gap > val.Max() ) if( val.HasMax() && gap > val.Max() )
insideRange = false; insideRange = false;
@ -419,10 +421,14 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run()
// drc_dbg(10, "Vmin %d vmax %d\n", val.Min(), val.Max() ); // drc_dbg(10, "Vmin %d vmax %d\n", val.Min(), val.Max() );
cpair.couplingOK = insideRange; 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 ); int totalLen = std::max( it.second.totalLengthN, it.second.totalLengthP );