Test: Change assertion type in range tests. Changes SDLTest_AssertPass(...) to SDLTest_AssertCheck(SDL_FALSE, ...) for failed assertions so the internal counter gets updated properly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
diff --git a/test/testautomation_math.c b/test/testautomation_math.c
index b57ce6c..d8f4fd4 100644
--- a/test/testautomation_math.c
+++ b/test/testautomation_math.c
@@ -128,9 +128,10 @@ helper_range(const char *func_name, d_to_d_func func)
result = func(test_value);
if (result != test_value) { /* Only log failures to save performances */
- SDLTest_AssertPass("%s(%.1f), expected %.1f, got %.1f",
- func_name, test_value,
- test_value, result);
+ SDLTest_AssertCheck(SDL_FALSE,
+ "%s(%.1f), expected %.1f, got %.1f",
+ func_name, test_value,
+ test_value, result);
return TEST_ABORTED;
}
}
@@ -666,17 +667,17 @@ copysign_rangeTest(void *args)
/* Only log failures to save performances */
result = SDL_copysign(test_value, 1.0);
if (result != test_value) {
- SDLTest_AssertPass("Copysign(%.1f,%.1f), expected %.1f, got %.1f",
- test_value, 1.0,
- test_value, result);
+ SDLTest_AssertCheck(SDL_FALSE,
+ "Copysign(%.1f,%.1f), expected %.1f, got %.1f",
+ test_value, 1.0, test_value, result);
return TEST_ABORTED;
}
result = SDL_copysign(test_value, -1.0);
if (result != -test_value) {
- SDLTest_AssertPass("Copysign(%.1f,%.1f), expected %.1f, got %.1f",
- test_value, -1.0,
- -test_value, result);
+ SDLTest_AssertCheck(SDL_FALSE,
+ "Copysign(%.1f,%.1f), expected %.1f, got %.1f",
+ test_value, -1.0, -test_value, result);
return TEST_ABORTED;
}
}
@@ -862,9 +863,9 @@ fmod_rangeTest(void *args)
/* Only log failures to save performances */
result = SDL_fmod(test_value, 1.0);
if (0.0 != result) {
- SDLTest_AssertPass("Fmod(%.1f,%.1f), expected %.1f, got %.1f",
- test_value, 1.0,
- 0.0, result);
+ SDLTest_AssertCheck(SDL_FALSE,
+ "Fmod(%.1f,%.1f), expected %.1f, got %.1f",
+ test_value, 1.0, 0.0, result);
return TEST_ABORTED;
}
}
@@ -1527,15 +1528,17 @@ pow_rangeTest(void *args)
/* Only log failures to save performances */
result = SDL_pow(test_value, 0.0);
if (result != 1.0) {
- SDLTest_AssertPass("Pow(%.1f,%.1f), expected %.1f, got %.1f",
- test_value, 1.0, 1.0, result);
+ SDLTest_AssertCheck(SDL_FALSE,
+ "Pow(%.1f,%.1f), expected %.1f, got %.1f",
+ test_value, 1.0, 1.0, result);
return TEST_ABORTED;
}
result = SDL_pow(test_value, -0.0);
if (result != 1.0) {
- SDLTest_AssertPass("Pow(%.1f,%.1f), expected %.1f, got %.1f",
- test_value, -0.0, 1.0, result);
+ SDLTest_AssertCheck(SDL_FALSE,
+ "Pow(%.1f,%.1f), expected %.1f, got %.1f",
+ test_value, -0.0, 1.0, result);
return TEST_ABORTED;
}
}