mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 03:18:13 +00:00
testautomation: don't do float equality tests
This commit is contained in:

committed by
Anonymous Maarten

parent
a6bc6b882c
commit
474c8d0073
@@ -77,7 +77,7 @@ helper_dtod(const char *func_name, d_to_d_func func,
|
|||||||
Uint32 i;
|
Uint32 i;
|
||||||
for (i = 0; i < cases_size; i++) {
|
for (i = 0; i < cases_size; i++) {
|
||||||
const double result = func(cases[i].input);
|
const double result = func(cases[i].input);
|
||||||
SDLTest_AssertCheck(result == cases[i].expected,
|
SDLTest_AssertCheck((result - cases[i].expected) < FLT_EPSILON,
|
||||||
"%s(%f), expected %f, got %f",
|
"%s(%f), expected %f, got %f",
|
||||||
func_name,
|
func_name,
|
||||||
cases[i].input,
|
cases[i].input,
|
||||||
@@ -1139,7 +1139,7 @@ log_baseCases(void *args)
|
|||||||
1.0, 0.0, result);
|
1.0, 0.0, result);
|
||||||
|
|
||||||
result = SDL_log(EULER);
|
result = SDL_log(EULER);
|
||||||
SDLTest_AssertCheck(1.0 == result,
|
SDLTest_AssertCheck((result - 1.) < FLT_EPSILON,
|
||||||
"Log(%f), expected %f, got %f",
|
"Log(%f), expected %f, got %f",
|
||||||
EULER, 1.0, result);
|
EULER, 1.0, result);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user