mirror of https://github.com/encounter/SDL.git
Test: Refactor math suites edge cases.
Split infinity and zero checks in their own functions. The result of NAN tests is now logged. The SDL_TestCaseReference structure were renamed to be more explicit.
This commit is contained in:
parent
a530fc9199
commit
3d720ba381
|
@ -32,26 +32,41 @@ typedef struct
|
||||||
/* SDL_floor tests functions */
|
/* SDL_floor tests functions */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Checks edge cases (0 and infinity) for themselves.
|
* \brief Checks positive and negative infinity.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
floor_edgeCases(void *args)
|
floor_infCases(void *args)
|
||||||
{
|
{
|
||||||
double result;
|
double result;
|
||||||
|
|
||||||
result = SDL_floor(INFINITY);
|
result = SDL_floor(INFINITY);
|
||||||
SDLTest_AssertCheck(INFINITY == result, "Floor(%f), expected %f, got %f",
|
SDLTest_AssertCheck(INFINITY == result,
|
||||||
|
"Floor(%f), expected %f, got %f",
|
||||||
INFINITY, INFINITY, result);
|
INFINITY, INFINITY, result);
|
||||||
|
|
||||||
result = SDL_floor(-INFINITY);
|
result = SDL_floor(-INFINITY);
|
||||||
SDLTest_AssertCheck(-INFINITY == result, "Floor(%f), expected %f, got %f",
|
SDLTest_AssertCheck(-INFINITY == result,
|
||||||
|
"Floor(%f), expected %f, got %f",
|
||||||
-INFINITY, -INFINITY, result);
|
-INFINITY, -INFINITY, result);
|
||||||
|
|
||||||
result = SDL_floor(0.0);
|
return TEST_COMPLETED;
|
||||||
SDLTest_AssertCheck(0.0 == result, "Floor(%.1f), expected %.1f, got %.1f",
|
}
|
||||||
0.0, 0.0, result);
|
|
||||||
result = SDL_floor(-0.0);
|
/**
|
||||||
SDLTest_AssertCheck(-0.0 == result, "Floor(%.1f), expected %.1f, got %.1f",
|
* \brief Checks positive and negative zero.
|
||||||
-0.0, -0.0, result);
|
*/
|
||||||
|
static int
|
||||||
|
floor_zeroCases(void *args)
|
||||||
|
{
|
||||||
|
Uint32 i;
|
||||||
|
const double zero_cases[] = { 0.0, -0.0 };
|
||||||
|
|
||||||
|
for (i = 0; i < SDL_arraysize(zero_cases); i++) {
|
||||||
|
const double result = SDL_floor(zero_cases[i]);
|
||||||
|
SDLTest_AssertCheck(result == zero_cases[i],
|
||||||
|
"Floor(%.1f), expected %.1f, got %.1f",
|
||||||
|
zero_cases[i], zero_cases[i], result);
|
||||||
|
}
|
||||||
|
|
||||||
return TEST_COMPLETED;
|
return TEST_COMPLETED;
|
||||||
}
|
}
|
||||||
|
@ -62,7 +77,10 @@ floor_edgeCases(void *args)
|
||||||
static int
|
static int
|
||||||
floor_nanCase(void *args)
|
floor_nanCase(void *args)
|
||||||
{
|
{
|
||||||
SDLTest_AssertCheck(isnan(SDL_floor(NAN)), "Floor(nan), expected nan");
|
const double result = SDL_floor(NAN);
|
||||||
|
SDLTest_AssertCheck(isnan(result),
|
||||||
|
"Floor(nan), expected nan, got %f",
|
||||||
|
result);
|
||||||
return TEST_COMPLETED;
|
return TEST_COMPLETED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,25 +172,42 @@ floor_rangeTest(void *args)
|
||||||
/* SDL_ceil tests functions */
|
/* SDL_ceil tests functions */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Checks edge cases (0 and infinity) for themselves.
|
* \brief Checks positive and negative infinity.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
ceil_edgeCases(void *args)
|
ceil_infCases(void *args)
|
||||||
{
|
{
|
||||||
double result;
|
double result;
|
||||||
|
|
||||||
result = SDL_ceil(INFINITY);
|
result = SDL_ceil(INFINITY);
|
||||||
SDLTest_AssertCheck(INFINITY == result, "Ceil(%f), expected %f, got %f",
|
SDLTest_AssertCheck(INFINITY == result,
|
||||||
|
"Ceil(%f), expected %f, got %f",
|
||||||
INFINITY, INFINITY, result);
|
INFINITY, INFINITY, result);
|
||||||
|
|
||||||
result = SDL_ceil(-INFINITY);
|
result = SDL_ceil(-INFINITY);
|
||||||
SDLTest_AssertCheck(-INFINITY == result, "Ceil(%f), expected %f, got %f",
|
SDLTest_AssertCheck(-INFINITY == result,
|
||||||
|
"Ceil(%f), expected %f, got %f",
|
||||||
-INFINITY, -INFINITY, result);
|
-INFINITY, -INFINITY, result);
|
||||||
|
|
||||||
|
return TEST_COMPLETED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Checks positive and negative zero.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
ceil_zeroCases(void *args)
|
||||||
|
{
|
||||||
|
double result;
|
||||||
|
|
||||||
result = SDL_ceil(0.0);
|
result = SDL_ceil(0.0);
|
||||||
SDLTest_AssertCheck(0.0 == result, "Ceil(%.1f), expected %.1f, got %.1f",
|
SDLTest_AssertCheck(0.0 == result,
|
||||||
|
"Ceil(%.1f), expected %.1f, got %.1f",
|
||||||
0.0, 0.0, result);
|
0.0, 0.0, result);
|
||||||
|
|
||||||
result = SDL_ceil(-0.0);
|
result = SDL_ceil(-0.0);
|
||||||
SDLTest_AssertCheck(-0.0 == result, "Ceil(%.1f), expected %.1f, got %.1f",
|
SDLTest_AssertCheck(-0.0 == result,
|
||||||
|
"Ceil(%.1f), expected %.1f, got %.1f",
|
||||||
-0.0, -0.0, result);
|
-0.0, -0.0, result);
|
||||||
|
|
||||||
return TEST_COMPLETED;
|
return TEST_COMPLETED;
|
||||||
|
@ -184,7 +219,10 @@ ceil_edgeCases(void *args)
|
||||||
static int
|
static int
|
||||||
ceil_nanCase(void *args)
|
ceil_nanCase(void *args)
|
||||||
{
|
{
|
||||||
SDLTest_AssertCheck(isnan(SDL_ceil(NAN)), "Ceil(nan), expected nan");
|
const double result = SDL_ceil(NAN);
|
||||||
|
SDLTest_AssertCheck(isnan(result),
|
||||||
|
"Ceil(nan), expected nan, got %f",
|
||||||
|
result);
|
||||||
return TEST_COMPLETED;
|
return TEST_COMPLETED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,25 +314,42 @@ ceil_rangeTest(void *args)
|
||||||
/* SDL_trunc tests functions */
|
/* SDL_trunc tests functions */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Checks edge cases (0 and infinity) for themselves.
|
* \brief Checks positive and negative infinity.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
trunc_edgeCases(void *args)
|
trunc_infCases(void *args)
|
||||||
{
|
{
|
||||||
double result;
|
double result;
|
||||||
|
|
||||||
result = SDL_trunc(INFINITY);
|
result = SDL_trunc(INFINITY);
|
||||||
SDLTest_AssertCheck(INFINITY == result, "Trunc(%f), expected %f, got %f",
|
SDLTest_AssertCheck(INFINITY == result,
|
||||||
|
"Trunc(%f), expected %f, got %f",
|
||||||
INFINITY, INFINITY, result);
|
INFINITY, INFINITY, result);
|
||||||
|
|
||||||
result = SDL_trunc(-INFINITY);
|
result = SDL_trunc(-INFINITY);
|
||||||
SDLTest_AssertCheck(-INFINITY == result, "Trunc(%f), expected %f, got %f",
|
SDLTest_AssertCheck(-INFINITY == result,
|
||||||
|
"Trunc(%f), expected %f, got %f",
|
||||||
-INFINITY, -INFINITY, result);
|
-INFINITY, -INFINITY, result);
|
||||||
|
|
||||||
|
return TEST_COMPLETED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Checks positive and negative zero.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
trunc_zeroCases(void *args)
|
||||||
|
{
|
||||||
|
double result;
|
||||||
|
|
||||||
result = SDL_trunc(0.0);
|
result = SDL_trunc(0.0);
|
||||||
SDLTest_AssertCheck(0.0 == result, "Trunc(%.1f), expected %.1f, got %.1f",
|
SDLTest_AssertCheck(0.0 == result,
|
||||||
|
"Trunc(%.1f), expected %.1f, got %.1f",
|
||||||
0.0, 0.0, result);
|
0.0, 0.0, result);
|
||||||
|
|
||||||
result = SDL_trunc(-0.0);
|
result = SDL_trunc(-0.0);
|
||||||
SDLTest_AssertCheck(-0.0 == result, "Trunc(%.1f), expected %.1f, got %.1f",
|
SDLTest_AssertCheck(-0.0 == result,
|
||||||
|
"Trunc(%.1f), expected %.1f, got %.1f",
|
||||||
-0.0, -0.0, result);
|
-0.0, -0.0, result);
|
||||||
|
|
||||||
return TEST_COMPLETED;
|
return TEST_COMPLETED;
|
||||||
|
@ -306,7 +361,10 @@ trunc_edgeCases(void *args)
|
||||||
static int
|
static int
|
||||||
trunc_nanCase(void *args)
|
trunc_nanCase(void *args)
|
||||||
{
|
{
|
||||||
SDLTest_AssertCheck(isnan(SDL_trunc(NAN)), "Trunc(nan), expected nan");
|
const double result = SDL_trunc(NAN);
|
||||||
|
SDLTest_AssertCheck(isnan(result),
|
||||||
|
"Trunc(nan), expected nan, got %f",
|
||||||
|
result);
|
||||||
return TEST_COMPLETED;
|
return TEST_COMPLETED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,25 +456,42 @@ trunc_rangeTest(void *args)
|
||||||
/* SDL_round tests functions */
|
/* SDL_round tests functions */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Checks edge cases (0 and infinity) for themselves.
|
* \brief Checks positive and negative infinity.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
round_edgeCases(void *args)
|
round_infCases(void *args)
|
||||||
{
|
{
|
||||||
double result;
|
double result;
|
||||||
|
|
||||||
result = SDL_round(INFINITY);
|
result = SDL_round(INFINITY);
|
||||||
SDLTest_AssertCheck(INFINITY == result, "Round(%f), expected %f, got %f",
|
SDLTest_AssertCheck(INFINITY == result,
|
||||||
|
"Round(%f), expected %f, got %f",
|
||||||
INFINITY, INFINITY, result);
|
INFINITY, INFINITY, result);
|
||||||
|
|
||||||
result = SDL_round(-INFINITY);
|
result = SDL_round(-INFINITY);
|
||||||
SDLTest_AssertCheck(-INFINITY == result, "Round(%f), expected %f, got %f",
|
SDLTest_AssertCheck(-INFINITY == result,
|
||||||
|
"Round(%f), expected %f, got %f",
|
||||||
-INFINITY, -INFINITY, result);
|
-INFINITY, -INFINITY, result);
|
||||||
|
|
||||||
|
return TEST_COMPLETED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Checks positive and negative zero.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
round_zeroCases(void *args)
|
||||||
|
{
|
||||||
|
double result;
|
||||||
|
|
||||||
result = SDL_round(0.0);
|
result = SDL_round(0.0);
|
||||||
SDLTest_AssertCheck(0.0 == result, "Round(%.1f), expected %.1f, got %.1f",
|
SDLTest_AssertCheck(0.0 == result,
|
||||||
|
"Round(%.1f), expected %.1f, got %.1f",
|
||||||
0.0, 0.0, result);
|
0.0, 0.0, result);
|
||||||
|
|
||||||
result = SDL_round(-0.0);
|
result = SDL_round(-0.0);
|
||||||
SDLTest_AssertCheck(-0.0 == result, "Round(%.1f), expected %.1f, got %.1f",
|
SDLTest_AssertCheck(-0.0 == result,
|
||||||
|
"Round(%.1f), expected %.1f, got %.1f",
|
||||||
-0.0, -0.0, result);
|
-0.0, -0.0, result);
|
||||||
|
|
||||||
return TEST_COMPLETED;
|
return TEST_COMPLETED;
|
||||||
|
@ -428,7 +503,10 @@ round_edgeCases(void *args)
|
||||||
static int
|
static int
|
||||||
round_nanCase(void *args)
|
round_nanCase(void *args)
|
||||||
{
|
{
|
||||||
SDLTest_AssertCheck(isnan(SDL_round(NAN)), "Round(nan), expected nan");
|
const double result = SDL_round(NAN);
|
||||||
|
SDLTest_AssertCheck(isnan(result),
|
||||||
|
"Round(nan), expected nan, got %f",
|
||||||
|
result);
|
||||||
return TEST_COMPLETED;
|
return TEST_COMPLETED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -520,25 +598,42 @@ round_rangeTest(void *args)
|
||||||
/* SDL_fabs tests functions */
|
/* SDL_fabs tests functions */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Checks edge cases (0 and infinity).
|
* \brief Checks positive and negative infinity.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
fabs_edgeCases(void *args)
|
fabs_infCases(void *args)
|
||||||
{
|
{
|
||||||
double result;
|
double result;
|
||||||
|
|
||||||
result = SDL_fabs(INFINITY);
|
result = SDL_fabs(INFINITY);
|
||||||
SDLTest_AssertCheck(INFINITY == result, "Fabs(%f), expected %f, got %f",
|
SDLTest_AssertCheck(INFINITY == result,
|
||||||
|
"Fabs(%f), expected %f, got %f",
|
||||||
INFINITY, INFINITY, result);
|
INFINITY, INFINITY, result);
|
||||||
|
|
||||||
result = SDL_fabs(-INFINITY);
|
result = SDL_fabs(-INFINITY);
|
||||||
SDLTest_AssertCheck(INFINITY == result, "Fabs(%f), expected %f, got %f",
|
SDLTest_AssertCheck(INFINITY == result,
|
||||||
|
"Fabs(%f), expected %f, got %f",
|
||||||
-INFINITY, INFINITY, result);
|
-INFINITY, INFINITY, result);
|
||||||
|
|
||||||
|
return TEST_COMPLETED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Checks positive and negative zero
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
fabs_zeroCases(void *args)
|
||||||
|
{
|
||||||
|
double result;
|
||||||
|
|
||||||
result = SDL_fabs(0.0);
|
result = SDL_fabs(0.0);
|
||||||
SDLTest_AssertCheck(0.0 == result, "Fabs(%.1f), expected %.1f, got %.1f",
|
SDLTest_AssertCheck(0.0 == result,
|
||||||
|
"Fabs(%.1f), expected %.1f, got %.1f",
|
||||||
0.0, 0.0, result);
|
0.0, 0.0, result);
|
||||||
|
|
||||||
result = SDL_fabs(-0.0);
|
result = SDL_fabs(-0.0);
|
||||||
SDLTest_AssertCheck(0.0 == result, "Fabs(%.1f), expected %.1f, got %.1f",
|
SDLTest_AssertCheck(0.0 == result,
|
||||||
|
"Fabs(%.1f), expected %.1f, got %.1f",
|
||||||
-0.0, 0.0, result);
|
-0.0, 0.0, result);
|
||||||
|
|
||||||
return TEST_COMPLETED;
|
return TEST_COMPLETED;
|
||||||
|
@ -550,7 +645,10 @@ fabs_edgeCases(void *args)
|
||||||
static int
|
static int
|
||||||
fabs_nanCase(void *args)
|
fabs_nanCase(void *args)
|
||||||
{
|
{
|
||||||
SDLTest_AssertCheck(isnan(SDL_fabs(NAN)), "Fabs(nan), expected nan");
|
const double result = SDL_fabs(NAN);
|
||||||
|
SDLTest_AssertCheck(isnan(result),
|
||||||
|
"Fabs(nan), expected nan, got %f",
|
||||||
|
result);
|
||||||
return TEST_COMPLETED;
|
return TEST_COMPLETED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -588,25 +686,62 @@ fabs_rangeTest(void *args)
|
||||||
/* SDL_copysign tests functions */
|
/* SDL_copysign tests functions */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Checks edge cases (0 and infinity).
|
* \brief Checks positive and negative inifnity.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
copysign_edgeCases(void *args)
|
copysign_infCases(void *args)
|
||||||
{
|
{
|
||||||
double result;
|
double result;
|
||||||
|
|
||||||
result = SDL_copysign(INFINITY, -1.0);
|
result = SDL_copysign(INFINITY, -1.0);
|
||||||
SDLTest_AssertCheck(-INFINITY == result, "Copysign(%f,%.1f), expected %f, got %f",
|
SDLTest_AssertCheck(-INFINITY == result,
|
||||||
|
"Copysign(%f,%.1f), expected %f, got %f",
|
||||||
INFINITY, -1.0, -INFINITY, result);
|
INFINITY, -1.0, -INFINITY, result);
|
||||||
|
|
||||||
|
result = SDL_copysign(INFINITY, 1.0);
|
||||||
|
SDLTest_AssertCheck(INFINITY == result,
|
||||||
|
"Copysign(%f,%.1f), expected %f, got %f",
|
||||||
|
INFINITY, 1.0, INFINITY, result);
|
||||||
|
|
||||||
|
result = SDL_copysign(-INFINITY, -1.0);
|
||||||
|
SDLTest_AssertCheck(-INFINITY == result,
|
||||||
|
"Copysign(%f,%.1f), expected %f, got %f",
|
||||||
|
-INFINITY, -1.0, -INFINITY, result);
|
||||||
|
|
||||||
result = SDL_copysign(-INFINITY, 1.0);
|
result = SDL_copysign(-INFINITY, 1.0);
|
||||||
SDLTest_AssertCheck(INFINITY == result, "Copysign(%f,%.1f), expected %f, got %f",
|
SDLTest_AssertCheck(INFINITY == result,
|
||||||
|
"Copysign(%f,%.1f), expected %f, got %f",
|
||||||
-INFINITY, 1.0, INFINITY, result);
|
-INFINITY, 1.0, INFINITY, result);
|
||||||
|
|
||||||
|
return TEST_COMPLETED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Checks positive and negative zero.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
copysign_zeroCases(void *args)
|
||||||
|
{
|
||||||
|
double result;
|
||||||
|
|
||||||
result = SDL_copysign(0.0, -1.0);
|
result = SDL_copysign(0.0, -1.0);
|
||||||
SDLTest_AssertCheck(0.0 == result, "Copysign(%f,%.1f), expected %f, got %f",
|
SDLTest_AssertCheck(-0.0 == result,
|
||||||
0.0, -1.0, 0.0, result);
|
"Copysign(%f,%.1f), expected %f, got %f",
|
||||||
|
0.0, -1.0, -0.0, result);
|
||||||
|
|
||||||
|
result = SDL_copysign(0.0, 1.0);
|
||||||
|
SDLTest_AssertCheck(0.0 == result,
|
||||||
|
"Copysign(%f,%.1f), expected %f, got %f",
|
||||||
|
0.0, 1.0, 0.0, result);
|
||||||
|
|
||||||
|
result = SDL_copysign(-0.0, -1.0);
|
||||||
|
SDLTest_AssertCheck(-0.0 == result,
|
||||||
|
"Copysign(%f,%.1f), expected %f, got %f",
|
||||||
|
-0.0, -1.0, -0.0, result);
|
||||||
|
|
||||||
result = SDL_copysign(-0.0, 1.0);
|
result = SDL_copysign(-0.0, 1.0);
|
||||||
SDLTest_AssertCheck(0.0 == result, "Copysign(%f,%.1f), expected %f, got %f",
|
SDLTest_AssertCheck(0.0 == result,
|
||||||
|
"Copysign(%f,%.1f), expected %f, got %f",
|
||||||
-0.0, 1.0, 0.0, result);
|
-0.0, 1.0, 0.0, result);
|
||||||
|
|
||||||
return TEST_COMPLETED;
|
return TEST_COMPLETED;
|
||||||
|
@ -616,10 +751,19 @@ copysign_edgeCases(void *args)
|
||||||
* \brief Checks the NaN cases.
|
* \brief Checks the NaN cases.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
copysign_nanCase(void *args)
|
copysign_nanCases(void *args)
|
||||||
{
|
{
|
||||||
SDLTest_AssertCheck(isnan(SDL_copysign(NAN, 1.0)), "Copysign(nan,1.0), expected nan");
|
double result;
|
||||||
SDLTest_AssertCheck(isnan(SDL_copysign(NAN, -1.0)), "Copysign(nan,-1.0), expected nan");
|
|
||||||
|
result = SDL_copysign(NAN, 1.0);
|
||||||
|
SDLTest_AssertCheck(isnan(result),
|
||||||
|
"Copysign(nan,1.0), expected nan, got %f",
|
||||||
|
result);
|
||||||
|
|
||||||
|
result = SDL_copysign(NAN, -1.0);
|
||||||
|
SDLTest_AssertCheck(isnan(result),
|
||||||
|
"Copysign(nan,-1.0), expected nan, got %f",
|
||||||
|
result);
|
||||||
return TEST_COMPLETED;
|
return TEST_COMPLETED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -668,133 +812,166 @@ copysign_rangeTest(void *args)
|
||||||
|
|
||||||
/* SDL_floor test cases */
|
/* SDL_floor test cases */
|
||||||
|
|
||||||
static const SDLTest_TestCaseReference floorTest1 = {
|
static const SDLTest_TestCaseReference floorTestInf = {
|
||||||
(SDLTest_TestCaseFp) floor_edgeCases, "floor_edgeCases",
|
(SDLTest_TestCaseFp) floor_infCases, "floor_infCases",
|
||||||
"Check positive and negative infinity and 0", TEST_ENABLED
|
"Check positive and negative infinity", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference floorTest2 = {
|
static const SDLTest_TestCaseReference floorTestZero = {
|
||||||
|
(SDLTest_TestCaseFp) floor_zeroCases, "floor_zeroCases",
|
||||||
|
"Check positive and negative zero", TEST_ENABLED
|
||||||
|
};
|
||||||
|
static const SDLTest_TestCaseReference floorTestNan = {
|
||||||
(SDLTest_TestCaseFp) floor_nanCase, "floor_nanCase",
|
(SDLTest_TestCaseFp) floor_nanCase, "floor_nanCase",
|
||||||
"Check the NaN special case", TEST_ENABLED
|
"Check the NaN special case", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference floorTest3 = {
|
static const SDLTest_TestCaseReference floorTestRound = {
|
||||||
(SDLTest_TestCaseFp) floor_roundNumbersCases, "floor_roundNumberCases",
|
(SDLTest_TestCaseFp) floor_roundNumbersCases, "floor_roundNumberCases",
|
||||||
"Check a set of round numbers", TEST_ENABLED
|
"Check a set of round numbers", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference floorTest4 = {
|
static const SDLTest_TestCaseReference floorTestFraction = {
|
||||||
(SDLTest_TestCaseFp) floor_fractionCases, "floor_fractionCases",
|
(SDLTest_TestCaseFp) floor_fractionCases, "floor_fractionCases",
|
||||||
"Check a set of fractions", TEST_ENABLED
|
"Check a set of fractions", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference floorTest5 = {
|
static const SDLTest_TestCaseReference floorTestRange = {
|
||||||
(SDLTest_TestCaseFp) floor_rangeTest, "floor_rangeTest",
|
(SDLTest_TestCaseFp) floor_rangeTest, "floor_rangeTest",
|
||||||
"Check a range of positive integer", TEST_ENABLED
|
"Check a range of positive integer", TEST_ENABLED
|
||||||
};
|
};
|
||||||
|
|
||||||
/* SDL_ceil test cases */
|
/* SDL_ceil test cases */
|
||||||
|
|
||||||
static const SDLTest_TestCaseReference ceilTest1 = {
|
static const SDLTest_TestCaseReference ceilTestInf = {
|
||||||
(SDLTest_TestCaseFp) ceil_edgeCases, "ceil_edgeCases",
|
(SDLTest_TestCaseFp) ceil_infCases, "ceil_infCases",
|
||||||
"Check positive and negative infinity and 0", TEST_ENABLED
|
"Check positive and negative infinity", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference ceilTest2 = {
|
static const SDLTest_TestCaseReference ceilTestZero = {
|
||||||
|
(SDLTest_TestCaseFp) ceil_zeroCases, "ceil_zeroCases",
|
||||||
|
"Check positive and negative zero", TEST_ENABLED
|
||||||
|
};
|
||||||
|
static const SDLTest_TestCaseReference ceilTestNan = {
|
||||||
(SDLTest_TestCaseFp) ceil_nanCase, "ceil_nanCase",
|
(SDLTest_TestCaseFp) ceil_nanCase, "ceil_nanCase",
|
||||||
"Check the NaN special case", TEST_ENABLED
|
"Check the NaN special case", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference ceilTest3 = {
|
static const SDLTest_TestCaseReference ceilTestRound = {
|
||||||
(SDLTest_TestCaseFp) ceil_roundNumbersCases, "ceil_roundNumberCases",
|
(SDLTest_TestCaseFp) ceil_roundNumbersCases, "ceil_roundNumberCases",
|
||||||
"Check a set of round numbers", TEST_ENABLED
|
"Check a set of round numbers", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference ceilTest4 = {
|
static const SDLTest_TestCaseReference ceilTestFraction = {
|
||||||
(SDLTest_TestCaseFp) ceil_fractionCases, "ceil_fractionCases",
|
(SDLTest_TestCaseFp) ceil_fractionCases, "ceil_fractionCases",
|
||||||
"Check a set of fractions", TEST_ENABLED
|
"Check a set of fractions", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference ceilTest5 = {
|
static const SDLTest_TestCaseReference ceilTestRange = {
|
||||||
(SDLTest_TestCaseFp) ceil_rangeTest, "ceil_rangeTest",
|
(SDLTest_TestCaseFp) ceil_rangeTest, "ceil_rangeTest",
|
||||||
"Check a range of positive integer", TEST_ENABLED
|
"Check a range of positive integer", TEST_ENABLED
|
||||||
};
|
};
|
||||||
|
|
||||||
/* SDL_trunc test cases */
|
/* SDL_trunc test cases */
|
||||||
|
|
||||||
static const SDLTest_TestCaseReference truncTest1 = {
|
static const SDLTest_TestCaseReference truncTestInf = {
|
||||||
(SDLTest_TestCaseFp) trunc_edgeCases, "trunc_edgeCases",
|
(SDLTest_TestCaseFp) trunc_infCases, "trunc_infCases",
|
||||||
"Check positive and negative infinity and 0", TEST_ENABLED
|
"Check positive and negative infinity", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference truncTest2 = {
|
static const SDLTest_TestCaseReference truncTestZero = {
|
||||||
|
(SDLTest_TestCaseFp) trunc_zeroCases, "trunc_zeroCases",
|
||||||
|
"Check positive and negative zero", TEST_ENABLED
|
||||||
|
};
|
||||||
|
static const SDLTest_TestCaseReference truncTestNan = {
|
||||||
(SDLTest_TestCaseFp) trunc_nanCase, "trunc_nanCase",
|
(SDLTest_TestCaseFp) trunc_nanCase, "trunc_nanCase",
|
||||||
"Check the NaN special case", TEST_ENABLED
|
"Check the NaN special case", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference truncTest3 = {
|
static const SDLTest_TestCaseReference truncTestRound = {
|
||||||
(SDLTest_TestCaseFp) trunc_roundNumbersCases, "trunc_roundNumberCases",
|
(SDLTest_TestCaseFp) trunc_roundNumbersCases, "trunc_roundNumberCases",
|
||||||
"Check a set of round numbers", TEST_ENABLED
|
"Check a set of round numbers", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference truncTest4 = {
|
static const SDLTest_TestCaseReference truncTestFraction = {
|
||||||
(SDLTest_TestCaseFp) trunc_fractionCases, "trunc_fractionCases",
|
(SDLTest_TestCaseFp) trunc_fractionCases, "trunc_fractionCases",
|
||||||
"Check a set of fractions", TEST_ENABLED
|
"Check a set of fractions", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference truncTest5 = {
|
static const SDLTest_TestCaseReference truncTestRange = {
|
||||||
(SDLTest_TestCaseFp) trunc_rangeTest, "trunc_rangeTest",
|
(SDLTest_TestCaseFp) trunc_rangeTest, "trunc_rangeTest",
|
||||||
"Check a range of positive integer", TEST_ENABLED
|
"Check a range of positive integer", TEST_ENABLED
|
||||||
};
|
};
|
||||||
|
|
||||||
/* SDL_round test cases */
|
/* SDL_round test cases */
|
||||||
|
|
||||||
static const SDLTest_TestCaseReference roundTest1 = {
|
static const SDLTest_TestCaseReference roundTestInf = {
|
||||||
(SDLTest_TestCaseFp) round_edgeCases, "round_edgeCases",
|
(SDLTest_TestCaseFp) round_infCases, "round_infCases",
|
||||||
"Check positive and negative infinity and 0", TEST_ENABLED
|
"Check positive and negative infinity", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference roundTest2 = {
|
static const SDLTest_TestCaseReference roundTestZero = {
|
||||||
|
(SDLTest_TestCaseFp) round_zeroCases, "round_zeroCases",
|
||||||
|
"Check positive and negative zero", TEST_ENABLED
|
||||||
|
};
|
||||||
|
static const SDLTest_TestCaseReference roundTestNan = {
|
||||||
(SDLTest_TestCaseFp) round_nanCase, "round_nanCase",
|
(SDLTest_TestCaseFp) round_nanCase, "round_nanCase",
|
||||||
"Check the NaN special case", TEST_ENABLED
|
"Check the NaN special case", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference roundTest3 = {
|
static const SDLTest_TestCaseReference roundTestRound = {
|
||||||
(SDLTest_TestCaseFp) round_roundNumbersCases, "round_roundNumberCases",
|
(SDLTest_TestCaseFp) round_roundNumbersCases, "round_roundNumberCases",
|
||||||
"Check a set of round numbers", TEST_ENABLED
|
"Check a set of round numbers", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference roundTest4 = {
|
static const SDLTest_TestCaseReference roundTestFraction = {
|
||||||
(SDLTest_TestCaseFp) round_fractionCases, "round_fractionCases",
|
(SDLTest_TestCaseFp) round_fractionCases, "round_fractionCases",
|
||||||
"Check a set of fractions", TEST_ENABLED
|
"Check a set of fractions", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference roundTest5 = {
|
static const SDLTest_TestCaseReference roundTestRange = {
|
||||||
(SDLTest_TestCaseFp) round_rangeTest, "round_rangeTest",
|
(SDLTest_TestCaseFp) round_rangeTest, "round_rangeTest",
|
||||||
"Check a range of positive integer", TEST_ENABLED
|
"Check a range of positive integer", TEST_ENABLED
|
||||||
};
|
};
|
||||||
|
|
||||||
/* SDL_fabs test cases */
|
/* SDL_fabs test cases */
|
||||||
|
|
||||||
static const SDLTest_TestCaseReference fabsTest1 = {
|
static const SDLTest_TestCaseReference fabsTestInf = {
|
||||||
(SDLTest_TestCaseFp) fabs_edgeCases, "fabs_edgeCases",
|
(SDLTest_TestCaseFp) fabs_infCases, "fabs_infCases",
|
||||||
"Check positive and negative infinity and 0", TEST_ENABLED
|
"Check positive and negative infinity", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference fabsTest2 = {
|
static const SDLTest_TestCaseReference fabsTestZero = {
|
||||||
|
(SDLTest_TestCaseFp) fabs_zeroCases, "fabs_zeroCases",
|
||||||
|
"Check positive and negative zero", TEST_ENABLED
|
||||||
|
};
|
||||||
|
static const SDLTest_TestCaseReference fabsTestNan = {
|
||||||
(SDLTest_TestCaseFp) fabs_nanCase, "fabs_nanCase",
|
(SDLTest_TestCaseFp) fabs_nanCase, "fabs_nanCase",
|
||||||
"Check the NaN special case", TEST_ENABLED
|
"Check the NaN special case", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference fabsTest3 = {
|
static const SDLTest_TestCaseReference fabsTestRange = {
|
||||||
(SDLTest_TestCaseFp) fabs_rangeTest, "fabs_rangeTest",
|
(SDLTest_TestCaseFp) fabs_rangeTest, "fabs_rangeTest",
|
||||||
"Check a range of positive integer", TEST_ENABLED
|
"Check a range of positive integer", TEST_ENABLED
|
||||||
};
|
};
|
||||||
|
|
||||||
/* SDL_copysign test cases */
|
/* SDL_copysign test cases */
|
||||||
|
|
||||||
static const SDLTest_TestCaseReference copysignTest1 = {
|
static const SDLTest_TestCaseReference copysignTestInf = {
|
||||||
(SDLTest_TestCaseFp) copysign_edgeCases, "copysign_edgeCases",
|
(SDLTest_TestCaseFp) copysign_infCases, "copysign_infCases",
|
||||||
"Check positive and negative infinity and 0", TEST_ENABLED
|
"Check positive and negative infinity", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference copysignTest2 = {
|
static const SDLTest_TestCaseReference copysignTestZero = {
|
||||||
(SDLTest_TestCaseFp) copysign_nanCase, "copysign_nanCase",
|
(SDLTest_TestCaseFp) copysign_zeroCases, "copysign_zeroCases",
|
||||||
"Check the NaN special case", TEST_ENABLED
|
"Check positive and negative zero", TEST_ENABLED
|
||||||
};
|
};
|
||||||
static const SDLTest_TestCaseReference copysignTest3 = {
|
static const SDLTest_TestCaseReference copysignTestNan = {
|
||||||
|
(SDLTest_TestCaseFp) copysign_nanCases, "copysign_nanCase",
|
||||||
|
"Check the NaN special cases", TEST_ENABLED
|
||||||
|
};
|
||||||
|
static const SDLTest_TestCaseReference copysignTestRange = {
|
||||||
(SDLTest_TestCaseFp) copysign_rangeTest, "copysign_rangeTest",
|
(SDLTest_TestCaseFp) copysign_rangeTest, "copysign_rangeTest",
|
||||||
"Check a range of positive integer", TEST_ENABLED
|
"Check a range of positive integer", TEST_ENABLED
|
||||||
};
|
};
|
||||||
|
|
||||||
static const SDLTest_TestCaseReference *mathTests[] = {
|
static const SDLTest_TestCaseReference *mathTests[] = {
|
||||||
&floorTest1, &floorTest2, &floorTest3, &floorTest4, &floorTest5,
|
&floorTestInf, &floorTestZero, &floorTestNan,
|
||||||
&ceilTest1, &ceilTest2, &ceilTest3, &ceilTest4, &ceilTest5,
|
&floorTestRound, &floorTestFraction, &floorTestRange,
|
||||||
&truncTest1, &truncTest2, &truncTest3, &truncTest4, &truncTest5,
|
|
||||||
&roundTest1, &roundTest2, &roundTest3, &roundTest4, &roundTest5,
|
&ceilTestInf, &ceilTestZero, &ceilTestNan,
|
||||||
&fabsTest1, &fabsTest2, &fabsTest3,
|
&ceilTestRound, &ceilTestFraction, &ceilTestRange,
|
||||||
©signTest1, ©signTest2, ©signTest3,
|
|
||||||
|
&truncTestInf, &truncTestZero, &truncTestNan,
|
||||||
|
&truncTestRound, &truncTestFraction, &truncTestRange,
|
||||||
|
|
||||||
|
&roundTestInf, &roundTestZero, &roundTestNan,
|
||||||
|
&roundTestRound, &roundTestFraction, &roundTestRange,
|
||||||
|
|
||||||
|
&fabsTestInf, &fabsTestZero, &fabsTestNan, &fabsTestRange,
|
||||||
|
|
||||||
|
©signTestInf, ©signTestZero, ©signTestNan, ©signTestRange,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue