Fix extract_int test std::pow problems
This commit is contained in:
parent
4b1b710322
commit
92596fe02e
@ -8,6 +8,7 @@
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/spirit/home/qi/numeric/numeric_utils.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <cmath> // for std::pow
|
||||
#include <iosfwd>
|
||||
#include <limits>
|
||||
#include <sstream>
|
||||
@ -87,7 +88,7 @@ void test_overflow_handling(char const* begin, char const* end, int i)
|
||||
{
|
||||
// Check that parser fails on overflow
|
||||
BOOST_STATIC_ASSERT_MSG(std::numeric_limits<T>::is_bounded, "tests prerequest");
|
||||
BOOST_ASSERT_MSG(MaxDigits == -1 || static_cast<int>(std::pow(Base, MaxDigits)) > T::max,
|
||||
BOOST_ASSERT_MSG(MaxDigits == -1 || static_cast<int>(std::pow(float(Base), MaxDigits)) > T::max,
|
||||
"test prerequest");
|
||||
int initial = Base - i % Base; // just a 'random' non-equal to i number
|
||||
T x(initial);
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/spirit/home/x3/support/numeric_utils/extract_int.hpp>
|
||||
#include <cmath> // for std::pow
|
||||
#include <cstdio>
|
||||
#include <iosfwd>
|
||||
#include <limits>
|
||||
@ -86,7 +87,7 @@ void test_overflow_handling(char const* begin, char const* end, int i)
|
||||
{
|
||||
// Check that parser fails on overflow
|
||||
static_assert(std::numeric_limits<T>::is_bounded, "tests prerequest");
|
||||
BOOST_ASSERT_MSG(MaxDigits == -1 || static_cast<int>(std::pow(Base, MaxDigits)) > T::max,
|
||||
BOOST_ASSERT_MSG(MaxDigits == -1 || static_cast<int>(std::pow(float(Base), MaxDigits)) > T::max,
|
||||
"test prerequest");
|
||||
int initial = Base - i % Base; // just a 'random' non-equal to i number
|
||||
T x { initial };
|
||||
|
Loading…
Reference in New Issue
Block a user