Skip to content

Commit 460b1b9

Browse files
committed
Suppress / fix additional test only warnings
1 parent 1669933 commit 460b1b9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/random_gccdecimal32_math.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#elif defined(__GNUC__)
1818
# pragma GCC diagnostic push
1919
# pragma GCC diagnostic ignored "-Wfloat-equal"
20+
# pragma GCC diagnostic ignored "-Wfloat-conversion"
21+
# pragma GCC diagnostic ignored "-Wconversion"
2022
#endif
2123

2224
#include <boost/core/lightweight_test.hpp>
@@ -376,7 +378,7 @@ void random_division(T lower, T upper)
376378
if (std::isinf(res) && std::isinf(res_int))
377379
{
378380
}
379-
else if (!BOOST_TEST(abs(res - res_int) < 0.001f))
381+
else if (!BOOST_TEST(std::fabs(res - res_int) < 0.001f))
380382
{
381383
// LCOV_EXCL_START
382384
std::cerr << "Val 1: " << val1
@@ -417,7 +419,7 @@ void random_mixed_division(T lower, T upper)
417419
if (std::isinf(res) && std::isinf(res_int))
418420
{
419421
}
420-
else if (!BOOST_TEST(abs(res - res_int) < 0.001f))
422+
else if (!BOOST_TEST(std::fabs(res - res_int) < 0.001f))
421423
{
422424
// LCOV_EXCL_START
423425
std::cerr << "Val 1: " << val1
@@ -444,7 +446,7 @@ void random_mixed_division(T lower, T upper)
444446
if (std::isinf(res) && std::isinf(res_int))
445447
{
446448
}
447-
else if (!BOOST_TEST(abs(res - res_int) < 0.01))
449+
else if (!BOOST_TEST(std::fabs(res - res_int) < 0.01))
448450
{
449451
// LCOV_EXCL_START
450452
std::cerr << "Val 1: " << val1

0 commit comments

Comments
 (0)