Translated tests for Math/Max

This commit is contained in:
Leonetienne 2022-02-11 11:24:55 +01:00
parent baa22608a6
commit b6ce760cda
2 changed files with 32 additions and 0 deletions

View File

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

31
Test/Math__Max.cpp Normal file
View File

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