Skip to content

Fix tests failing for 32-bit targets #593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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