mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
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:
parent
3ed5441067
commit
d1e7344f16
@ -40,7 +40,7 @@ namespace Catch {
|
|||||||
// is terrible and we should move on.
|
// is terrible and we should move on.
|
||||||
// TBD: How to signal that the measured resolution is probably wrong?
|
// TBD: How to signal that the measured resolution is probably wrong?
|
||||||
if (ticks > startTime + 3 * nanosecondsInSecond) {
|
if (ticks > startTime + 3 * nanosecondsInSecond) {
|
||||||
return sum / i;
|
return sum / ( i + 1u );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user