From 2cb550d65ec2e5109507f23e06ce751dc5474f2d Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 16 Nov 2023 11:39:53 +0100 Subject: [PATCH] Replace C style asserts with BOOST_MATH_ASSERT --- test/ccmath_ceil_test.cpp | 6 +++--- test/ccmath_floor_test.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/ccmath_ceil_test.cpp b/test/ccmath_ceil_test.cpp index b898477609..5a407473d9 100644 --- a/test/ccmath_ceil_test.cpp +++ b/test/ccmath_ceil_test.cpp @@ -40,15 +40,15 @@ constexpr void test() constexpr T half_max_ceil = boost::math::ccmath::ceil(T((std::numeric_limits::max)() / 2)); static_assert(half_max_ceil == (std::numeric_limits::max)() / 2); - assert(half_max_ceil == std::ceil((std::numeric_limits::max)() / 2)); + BOOST_MATH_ASSERT(half_max_ceil == std::ceil((std::numeric_limits::max)() / 2)); constexpr T third_max_ceil = boost::math::ccmath::ceil(T((std::numeric_limits::max)() / 3)); static_assert(third_max_ceil == (std::numeric_limits::max)() / 3); - assert(third_max_ceil == std::ceil((std::numeric_limits::max)() / 3)); + BOOST_MATH_ASSERT(third_max_ceil == std::ceil((std::numeric_limits::max)() / 3)); constexpr T one_over_eps = boost::math::ccmath::ceil(1 / T(std::numeric_limits::epsilon())); static_assert(one_over_eps == 1 / T(std::numeric_limits::epsilon())); - assert(one_over_eps != std::ceil(1 / T(std::numeric_limits::epsilon()))) + BOOST_MATH_ASSERT(one_over_eps == std::ceil(1 / T(std::numeric_limits::epsilon()))); } #if !defined(BOOST_MATH_NO_CONSTEXPR_DETECTION) && !defined(BOOST_MATH_USING_BUILTIN_CONSTANT_P) diff --git a/test/ccmath_floor_test.cpp b/test/ccmath_floor_test.cpp index 149513cd71..6a06787b00 100644 --- a/test/ccmath_floor_test.cpp +++ b/test/ccmath_floor_test.cpp @@ -40,15 +40,15 @@ constexpr void test() constexpr T half_max_floor = boost::math::ccmath::floor(T((std::numeric_limits::max)() / 2)); static_assert(half_max_floor == (std::numeric_limits::max)() / 2); - assert(half_max_floor == std::floor((std::numeric_limits::max)() / 2)); + BOOST_MATH_ASSERT(half_max_floor == std::floor((std::numeric_limits::max)() / 2)); constexpr T third_max_floor = boost::math::ccmath::floor(T((std::numeric_limits::max)() / 3)); static_assert(third_max_floor == (std::numeric_limits::max)() / 3); - assert(third_max_floor == std::floor((std::numeric_limits::max)() / 3)); + BOOST_MATH_ASSERT(third_max_floor == std::floor((std::numeric_limits::max)() / 3)); constexpr T one_over_eps = boost::math::ccmath::floor(1 / T(std::numeric_limits::epsilon())); static_assert(one_over_eps == 1 / T(std::numeric_limits::epsilon())); - assert(one_over_eps == std::floor(1 / T(std::numeric_limits::epsilon()))); + BOOST_MATH_ASSERT(one_over_eps == std::floor(1 / T(std::numeric_limits::epsilon()))); } #if !defined(BOOST_MATH_NO_CONSTEXPR_DETECTION) && !defined(BOOST_MATH_USING_BUILTIN_CONSTANT_P)