Translated tests for Math/Min
This commit is contained in:
parent
b6ce760cda
commit
51421188c7
@ -15,6 +15,7 @@ add_executable(Tests
|
|||||||
Math__Clamp.cpp
|
Math__Clamp.cpp
|
||||||
Math__Lerp.cpp
|
Math__Lerp.cpp
|
||||||
Math__Max.cpp
|
Math__Max.cpp
|
||||||
|
Math__Min.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(Tests Eule)
|
target_link_libraries(Tests Eule)
|
||||||
|
43
Test/Math__Min.cpp
Normal file
43
Test/Math__Min.cpp
Normal 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;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user