Fix proper relative tolerance checking in testutils
commitc06840fe4e1caa5e40c8f8e8d236b9720d03b7f2
authorErik Lindahl <erik@kth.se>
Sun, 31 Jul 2016 16:34:36 +0000 (31 18:34 +0200)
committerTeemu Murtola <teemu.murtola@gmail.com>
Fri, 5 Aug 2016 07:01:36 +0000 (5 09:01 +0200)
tree281c92373d67efd4cde9266d07ac413e3eb11256
parent86cd1936c19f953271ef8a33eb83871d46edab14
Fix proper relative tolerance checking in testutils

The previous relative tolerances were convereted to ULP
checks, but since the relative difference for 1 ULP
depends on whether the exponent changes there is no strict
1-to-1 correspondence between ULP and relative differences.
Fixed by storing the original magnitude of the numbers
in FloatingPointDifference and using a traditional relative
tolerance check for the case when a relative tolerance is
set from floating point values; other checks still use ULP.

Change-Id: I95331b46da00cd0b4e369f087991c553cd05f18f
src/testutils/testasserts.cpp
src/testutils/testasserts.h