Translated tests for Math/Min

This commit is contained in:
Leonetienne 2022-02-11 11:26:53 +01:00
parent b6ce760cda
commit 51421188c7
2 changed files with 44 additions and 0 deletions

View File

@ -15,6 +15,7 @@ add_executable(Tests
Math__Clamp.cpp
Math__Lerp.cpp
Math__Max.cpp
Math__Min.cpp
)
target_link_libraries(Tests Eule)

43
Test/Math__Min.cpp Normal file
View File

@ -0,0 +1,43 @@
#include "Catch2.h"
#include <Eule/Math.h>
using namespace Eule;
/** Equivalence classes:
* -- min < v < max
* -- v < min < max
* -- min < max < v
* -- v == min < max
* -- min < v == max
* -- v < max == min
* -- max == min < v
* -- max == min == v
* -- max < v < min
*/
/** Equivalence classes:
* -- a < b
* -- a > b
* -- a == b
*/
// a < b
TEST_CASE(__FILE__"/a_lt_b", "[Math][Min]")
{
REQUIRE(Math::Min(4.0, 9.0) == 4.0);
return;
}
// a > b
TEST_CASE(__FILE__"/a_gt_b", "[Math][Min]")
{
REQUIRE(Math::Min(9.0, 4.0) == 4.0);
return;
}
// a == b
TEST_CASE(__FILE__"/a_eq_b", "[Math][Min]")
{
REQUIRE(Math::Min(9.0, 9.0) == 9.0);
return;
}