Translated tests for math/abs
This commit is contained in:
parent
d17993a322
commit
c220cad835
@ -10,6 +10,8 @@ add_executable(Tests
|
|||||||
Catch2.h
|
Catch2.h
|
||||||
main.cpp
|
main.cpp
|
||||||
Math__Mod.cpp
|
Math__Mod.cpp
|
||||||
|
Math__Oscillate.cpp
|
||||||
|
Math__Abs.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(Tests Eule)
|
target_link_libraries(Tests Eule)
|
||||||
|
31
Test/Math__Abs.cpp
Normal file
31
Test/Math__Abs.cpp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#include "Catch2.h"
|
||||||
|
#include <Eule/Math.h>
|
||||||
|
|
||||||
|
using namespace Eule;
|
||||||
|
|
||||||
|
/** Equivalence classes:
|
||||||
|
* -- value > 0
|
||||||
|
* -- value < 0
|
||||||
|
* -- value == 0
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Checks with a positive input
|
||||||
|
TEST_CASE("Positive_Value", "[Math][Abs]")
|
||||||
|
{
|
||||||
|
REQUIRE(Math::Abs(45.0) == 45.0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Checks with a negative input
|
||||||
|
TEST_CASE("Negative_Value", "[Math][Abs]")
|
||||||
|
{
|
||||||
|
REQUIRE(Math::Abs(-45.0) == 45);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Checks with a zero input
|
||||||
|
TEST_CASE("Zero_Value", "[Math][Abs]")
|
||||||
|
{
|
||||||
|
REQUIRE(Math::Abs(0.0) == 0.0);
|
||||||
|
return;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user