From dd2dc510bc296c474da683313817aec6b0370694 Mon Sep 17 00:00:00 2001 From: "andrey.zhirnov" Date: Fri, 21 Jun 2019 11:19:40 +0300 Subject: [PATCH] fixed math unittests --- headers/enduro2d/math/_math.hpp | 4 ++-- untests/sources/untests_math/_math.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/headers/enduro2d/math/_math.hpp b/headers/enduro2d/math/_math.hpp index fc55690a..cd09490a 100644 --- a/headers/enduro2d/math/_math.hpp +++ b/headers/enduro2d/math/_math.hpp @@ -703,7 +703,7 @@ namespace e2d::math template < typename T, typename U > std::enable_if_t< - std::is_unsigned_v && + std::is_integral_v && std::is_convertible_v, T> align_ceil (T v, U alignment) { @@ -714,7 +714,7 @@ namespace e2d::math template < typename T, typename U > std::enable_if_t< - std::is_unsigned_v && + std::is_integral_v && std::is_convertible_v, T> align_floor (T v, U alignment) { diff --git a/untests/sources/untests_math/_math.cpp b/untests/sources/untests_math/_math.cpp index 99dab28c..31222533 100644 --- a/untests/sources/untests_math/_math.cpp +++ b/untests/sources/untests_math/_math.cpp @@ -662,7 +662,7 @@ TEST_CASE("math") { REQUIRE_FALSE(math::approximately(umax,umin,1)); } { - REQUIRE(math::align_ceil(11, 4) == 16); - REQUIRE(math::align_floor(11, 4) == 8); + REQUIRE(math::align_ceil(11, 4) == 12); + REQUIRE(math::align_floor(11, 4u) == 8); } }