Skip to content

Commit

Permalink
Fix tests failing for 32-bit targets
Browse files Browse the repository at this point in the history
  • Loading branch information
grisumbras committed Jul 6, 2021
1 parent 745be88 commit ccf41db
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions test/value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1473,8 +1473,9 @@ class value_test
THRO(std::uint16_t);
EQUS(std::uint32_t);
EQUS(std::uint64_t);
EQUF(float);
EQAL(double);
// EQUF(float) will result in loss of precision, so the test might
// fail depending on compilation flags and target platform
}
{
auto V = max_of<std::int64_t>();
Expand All @@ -1487,8 +1488,9 @@ class value_test
THRO(std::uint16_t);
THRO(std::uint32_t);
EQUS(std::uint64_t);
EQUF(float);
EQUF(double);
// EQUF(float) will result in loss of precision, so the test might
// fail depending on compilation flags and target platform
}
//---
{
Expand Down Expand Up @@ -1647,6 +1649,19 @@ class value_test
EQAL(float);
EQAL(double);
}
//---
{
// fill with the number of ones equal to the size of float's
// mantissa; such a number can be converted to float without loss
// of precision
std::int64_t V = 1;
for( int i = 0; i <= std::numeric_limits<float>::digits - 1; ++i )
V *= 2;
--V;

value const jv(V);
EQUF(float);
}

error_code ec;
value(nullptr).to_number<double>(ec);
Expand Down

0 comments on commit ccf41db

Please sign in to comment.