From f5cc5a1cc405caedf17f31ca692d67d4b2351767 Mon Sep 17 00:00:00 2001 From: NAThompson Date: Mon, 15 Jul 2019 10:30:40 -0400 Subject: [PATCH] Cardinal B-splines: Update math_unit_test to support expected values which are integers. [CI SKIP] --- test/math_unit_test.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/math_unit_test.hpp b/test/math_unit_test.hpp index 79f3dab34..d6f5578c6 100644 --- a/test/math_unit_test.hpp +++ b/test/math_unit_test.hpp @@ -69,8 +69,11 @@ bool check_ulp_close(PreciseReal expected1, Real computed, size_t ulps, std::str using std::max; using std::abs; using std::isnan; - BOOST_ASSERT_MSG(sizeof(PreciseReal) >= sizeof(Real), - "The expected number must be computed in higher (or equal) precision than the number being tested."); + // Of course integers can be expected values, and they are exact: + if (!std::is_integral::value) { + BOOST_ASSERT_MSG(sizeof(PreciseReal) >= sizeof(Real), + "The expected number must be computed in higher (or equal) precision than the number being tested."); + } BOOST_ASSERT_MSG(!isnan(expected1), "Expected value cannot be a nan."); if (isnan(computed))