mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 04:07: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:
		 Axel Huebl
					Axel Huebl
				
			
				
					committed by
					
						 Martin Hořeňovský
						Martin Hořeňovský
					
				
			
			
				
	
			
			
			 Martin Hořeňovský
						Martin Hořeňovský
					
				
			
						parent
						
							3ed5441067
						
					
				
				
					commit
					d1e7344f16
				
			| @@ -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 ); | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user