mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
testautomation_math: Fix misleading log output
These originally checked for expected ± EPSILON as logged, but since commit880c6939
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" Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:

committed by
Sam Lantinga

parent
b66dba2a9d
commit
7c089f4e57
@@ -112,11 +112,10 @@ helper_dtod_inexact(const char *func_name, d_to_d_func func,
|
||||
max_err = -max_err;
|
||||
}
|
||||
SDLTest_AssertCheck(diff <= max_err,
|
||||
"%s(%f), expected [%f,%f], got %f",
|
||||
"%s(%f), expected %f +/- %g, got %f",
|
||||
func_name,
|
||||
cases[i].input,
|
||||
cases[i].expected - EPSILON,
|
||||
cases[i].expected + EPSILON,
|
||||
cases[i].expected, max_err,
|
||||
result);
|
||||
}
|
||||
|
||||
@@ -175,11 +174,10 @@ helper_ddtod_inexact(const char *func_name, dd_to_d_func func,
|
||||
}
|
||||
|
||||
SDLTest_AssertCheck(diff <= max_err,
|
||||
"%s(%f,%f), expected [%f,%f], got %f",
|
||||
"%s(%f,%f), expected %f +/- %g, got %f",
|
||||
func_name,
|
||||
cases[i].x_input, cases[i].y_input,
|
||||
cases[i].expected - EPSILON,
|
||||
cases[i].expected + EPSILON,
|
||||
cases[i].expected, max_err,
|
||||
result);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user