Eule/Test/Math__Abs.cpp

32 lines
594 B
C++
Raw Normal View History

2022-02-11 11:13:56 +01:00
#include "Catch2.h"
#include <Eule/Math.h>
2022-03-06 20:05:34 +01:00
using namespace Leonetienne::Eule;
2022-02-11 11:13:56 +01:00
/** Equivalence classes:
* -- value > 0
* -- value < 0
* -- value == 0
*/
// Checks with a positive input
2022-02-11 11:17:31 +01:00
TEST_CASE(__FILE__"/Positive_Value", "[Math][Abs]")
2022-02-11 11:13:56 +01:00
{
REQUIRE(Math::Abs(45.0) == 45.0);
return;
}
// Checks with a negative input
2022-02-11 11:17:31 +01:00
TEST_CASE(__FILE__"/Negative_Value", "[Math][Abs]")
2022-02-11 11:13:56 +01:00
{
REQUIRE(Math::Abs(-45.0) == 45);
return;
}
// Checks with a zero input
2022-02-11 11:17:31 +01:00
TEST_CASE(__FILE__"/Zero_Value", "[Math][Abs]")
2022-02-11 11:13:56 +01:00
{
REQUIRE(Math::Abs(0.0) == 0.0);
return;
}