From 51421188c73410028c0724266e9200a08912c140 Mon Sep 17 00:00:00 2001 From: Leonetienne Date: Fri, 11 Feb 2022 11:26:53 +0100 Subject: [PATCH] Translated tests for Math/Min --- Test/CMakeLists.txt | 1 + Test/Math__Min.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 Test/Math__Min.cpp diff --git a/Test/CMakeLists.txt b/Test/CMakeLists.txt index 6dfbbf9..22dbe81 100644 --- a/Test/CMakeLists.txt +++ b/Test/CMakeLists.txt @@ -15,6 +15,7 @@ add_executable(Tests Math__Clamp.cpp Math__Lerp.cpp Math__Max.cpp + Math__Min.cpp ) target_link_libraries(Tests Eule) diff --git a/Test/Math__Min.cpp b/Test/Math__Min.cpp new file mode 100644 index 0000000..68ac59b --- /dev/null +++ b/Test/Math__Min.cpp @@ -0,0 +1,43 @@ +#include "Catch2.h" +#include + +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; +}