ClockEstimate: DivByZero

The clock estimator has a potential division by zero.
Using `iteration + 1` seems also more logical to me for
an average.

Found with coverity in a downstream project.
This commit is contained in:
Axel Huebl 2019-01-07 18:26:28 +01:00 committed by Martin Hořeňovský
parent 3ed5441067
commit d1e7344f16

View File

@ -40,7 +40,7 @@ namespace Catch {
// is terrible and we should move on.
// TBD: How to signal that the measured resolution is probably wrong?
if (ticks > startTime + 3 * nanosecondsInSecond) {
return sum / i;
return sum / ( i + 1u );
}
}