test: Don't accept results that are much less than expected
While looking at the other tests in this file, I noticed that instead
of checking for a result in the range of expected ± FLT_EPSILON as I
would have expected, these tests would accept any result strictly less
than expected + FLT_EPSILON, for example a wrong result that is very
large and negative. This is presumably not what was intended, so add
the SDL_fabs() that I assume was meant to be here.
Fixes: 474c8d00 "testautomation: don't do float equality tests"
Signed-off-by: Simon McVittie smcv@collabora.com
testautomation: Don't expect exp to yield exact floating point results
In the Steam Runtime 1 'scout' environment, when compiling for i386
using the default gcc-4.6, Exp(34.125) matches the desired value to the
precision shown in the log (6 decimal places) but is not an exact match
for the desired value.
testautomation_math: Fix misleading log output
These originally checked for expected ± EPSILON as logged, but since
commit 880c6939 they check for expected ± max_err, where max_err may
need to be greater than EPSILON for very large expected results like
the ones in exp_regularCases().
Also, EPSILON is so small that the default precision of the %f format
(6 decimal places) would never actually have shown its effect, so log
it in scientific notation instead.
Fixes: 880c6939 "testautomation_math: do relative comparison + more precise correct trigonometric values"
sdl2-compat version of libsdl-org/SDL#8948. We don't need a backport (forward-port? sideways-port?) of https://github.com/libsdl-org/SDL/commit/880c69392ae10c726fc97f17b6e5e2173f70b62f here, because it was included in commit cc419053 "sync tests with latest SDL2."
test: Don't accept results that are much less than expected
While looking at the other tests in this file, I noticed that instead of checking for a result in the range of expected ± FLT_EPSILON as I would have expected, these tests would accept any result strictly less than expected + FLT_EPSILON, for example a wrong result that is very large and negative. This is presumably not what was intended, so add the SDL_fabs() that I assume was meant to be here.
Fixes: 474c8d00 "testautomation: don't do float equality tests" Signed-off-by: Simon McVittie smcv@collabora.com
testautomation: Don't expect exp to yield exact floating point results
In the Steam Runtime 1 'scout' environment, when compiling for i386 using the default gcc-4.6, Exp(34.125) matches the desired value to the precision shown in the log (6 decimal places) but is not an exact match for the desired value.
testautomation_math: Fix misleading log output
These originally checked for expected ± EPSILON as logged, but since commit 880c6939 they check for expected ± max_err, where max_err may need to be greater than EPSILON for very large expected results like the ones in exp_regularCases().
Also, EPSILON is so small that the default precision of the %f format (6 decimal places) would never actually have shown its effect, so log it in scientific notation instead.
Fixes: 880c6939 "testautomation_math: do relative comparison + more precise correct trigonometric values"