mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-03-24 04:35:03 +00:00
Test: Fix C89 declaration and math include.
This commit is contained in:
parent
b3faebb8a8
commit
7389eba943
|
@ -2,6 +2,8 @@
|
||||||
* Math test suite
|
* Math test suite
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
#include "SDL_test.h"
|
#include "SDL_test.h"
|
||||||
|
|
||||||
|
@ -76,12 +78,13 @@ static int floor_rangeTest(void* args) {
|
||||||
SDLTest_AssertPass("Floor: Testing a range of %u values with %u steps",
|
SDLTest_AssertPass("Floor: Testing a range of %u values with %u steps",
|
||||||
ITERATIONS, STEP);
|
ITERATIONS, STEP);
|
||||||
for (Uint32 i = 0; i < ITERATIONS; i++, test_value += STEP) {
|
for (Uint32 i = 0; i < ITERATIONS; i++, test_value += STEP) {
|
||||||
|
double result;
|
||||||
/* These are tested elsewhere */
|
/* These are tested elsewhere */
|
||||||
if (isnan(test_value) || isinf(test_value)) {
|
if (isnan(test_value) || isinf(test_value)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const double result = SDL_floor(test_value);
|
result = SDL_floor(test_value);
|
||||||
if (result != test_value) { /* Only log failures to save performances */
|
if (result != test_value) { /* Only log failures to save performances */
|
||||||
SDLTest_AssertPass("Floor(%.1f), expected %.1f, got %.1f", test_value,
|
SDLTest_AssertPass("Floor(%.1f), expected %.1f, got %.1f", test_value,
|
||||||
test_value, result);
|
test_value, result);
|
||||||
|
|
Loading…
Reference in a new issue