mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 04:07:10 +01:00 
			
		
		
		
	Add a Relative Comparison matcher for floating point numbers
It checks Knuth's _close enough with tolerance_ relationship, that is `|lhs - rhs| <= epsilon * max(|lhs|, |rhs|)`, rather then the _very close with tolerance_ relationship that can be written down as `|lhs - rhs| <= epsilon * min(|lhs|, |rhs|)`. This is because it is the more common model around the internet, and as such is likely to be less surprising to the users. In the future we might want to provide the other model as well. Closes #1746
This commit is contained in:
		| @@ -1,7 +1,7 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <testsuitesloose text artifact | ||||
| > | ||||
|   <testsuite name="<exe-name>" errors="17" failures="132" tests="1615" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> | ||||
|   <testsuite name="<exe-name>" errors="17" failures="132" tests="1633" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> | ||||
|     <properties> | ||||
|       <property name="filters" value="~[!nonportable]~[!benchmark]~[approvals]"/> | ||||
|       <property name="random-seed" value="1"/> | ||||
| @@ -402,10 +402,14 @@ Message.tests.cpp:<line number> | ||||
|       </failure> | ||||
|     </testcase> | ||||
|     <testcase classname="<exe-name>.global" name="Factorials are computed" time="{duration}"/> | ||||
|     <testcase classname="<exe-name>.global" name="Floating point matchers: double/Relative" time="{duration}"/> | ||||
|     <testcase classname="<exe-name>.global" name="Floating point matchers: double/Relative/Some subnormal values" time="{duration}"/> | ||||
|     <testcase classname="<exe-name>.global" name="Floating point matchers: double/Margin" time="{duration}"/> | ||||
|     <testcase classname="<exe-name>.global" name="Floating point matchers: double/ULPs" time="{duration}"/> | ||||
|     <testcase classname="<exe-name>.global" name="Floating point matchers: double/Composed" time="{duration}"/> | ||||
|     <testcase classname="<exe-name>.global" name="Floating point matchers: double/Constructor validation" time="{duration}"/> | ||||
|     <testcase classname="<exe-name>.global" name="Floating point matchers: float/Relative" time="{duration}"/> | ||||
|     <testcase classname="<exe-name>.global" name="Floating point matchers: float/Relative/Some subnormal values" time="{duration}"/> | ||||
|     <testcase classname="<exe-name>.global" name="Floating point matchers: float/Margin" time="{duration}"/> | ||||
|     <testcase classname="<exe-name>.global" name="Floating point matchers: float/ULPs" time="{duration}"/> | ||||
|     <testcase classname="<exe-name>.global" name="Floating point matchers: float/Composed" time="{duration}"/> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský