From 2ef31972b3f7713a564f81ac762ae94c06a5d3e7 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 27 Jun 2024 10:13:14 -0400 Subject: [PATCH 1/3] Ignore coverage on debug statements --- test/compare_dec128_and_fast.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/compare_dec128_and_fast.cpp b/test/compare_dec128_and_fast.cpp index ba0c414d5..d07d1b063 100644 --- a/test/compare_dec128_and_fast.cpp +++ b/test/compare_dec128_and_fast.cpp @@ -205,6 +205,8 @@ void test_mul() if (!BOOST_TEST_EQ(static_cast(dec128_res), static_cast(dec128_fast_res))) { + // LCOV_EXCL_START + std::cerr << std::setprecision(35) << "Val 1: " << val1 << "\nVal 2: " << val2 @@ -214,6 +216,8 @@ void test_mul() << "\nDecfast 1: " << dec128_fast_1 << "\nDecfast 2: " << dec128_fast_2 << "\nDecfast res: " << dec128_fast_res << std::endl; + + // LCOV_EXCL_STOP } } @@ -234,6 +238,8 @@ void test_mul() if (!BOOST_TEST_EQ(static_cast(dec128_res), static_cast(dec128_fast_res))) { + // LCOV_EXCL_START + std::cerr << std::setprecision(35) << "Val 1: " << val1 << "\nVal 2: " << val2 @@ -243,6 +249,8 @@ void test_mul() << "\nDecfast 1: " << dec128_fast_1 << "\nDecfast 2: " << dec128_fast_2 << "\nDecfast res: " << dec128_fast_res << std::endl; + + // LCOV_EXCL_STOP } } } @@ -266,6 +274,8 @@ void test_div() if (!BOOST_TEST_EQ(static_cast(dec128_res), static_cast(dec128_fast_res))) { + // LCOV_EXCL_START + std::cerr << std::setprecision(35) << "Val 1: " << val1 << "\nVal 2: " << val2 @@ -275,6 +285,8 @@ void test_div() << "\nDecfast 1: " << dec128_fast_1 << "\nDecfast 2: " << dec128_fast_2 << "\nDecfast res: " << dec128_fast_res << std::endl; + + // LCOV_EXCL_STOP } } @@ -295,6 +307,8 @@ void test_div() if (!BOOST_TEST_EQ(static_cast(dec128_res), static_cast(dec128_fast_res))) { + // LCOV_EXCL_START + std::cerr << std::setprecision(35) << "Val 1: " << val1 << "\nVal 2: " << val2 @@ -304,6 +318,8 @@ void test_div() << "\nDecfast 1: " << dec128_fast_1 << "\nDecfast 2: " << dec128_fast_2 << "\nDecfast res: " << dec128_fast_res << std::endl; + + // LCOV_EXCL_STOP } } } From 4d81050343d1a4a8a901dec269aa79ae287c7a84 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 27 Jun 2024 10:15:11 -0400 Subject: [PATCH 2/3] Ignore probabilistic continue statement --- test/random_decimal128_fast_math.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/random_decimal128_fast_math.cpp b/test/random_decimal128_fast_math.cpp index 7779423e6..d7a41955f 100644 --- a/test/random_decimal128_fast_math.cpp +++ b/test/random_decimal128_fast_math.cpp @@ -241,7 +241,7 @@ void random_multiplication(T lower, T upper) if (val1 * val2 == 0) { - continue; + continue; // LCOV_EXCL_LINE } if (!BOOST_TEST_EQ(res, res_int)) From 4ed4b020cb916c6898d6fbeb743831c37a1f73bd Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 27 Jun 2024 10:16:16 -0400 Subject: [PATCH 3/3] Probabilistic test path --- test/test_cmath.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test_cmath.cpp b/test/test_cmath.cpp index dada43200..8e69adc24 100644 --- a/test/test_cmath.cpp +++ b/test/test_cmath.cpp @@ -802,6 +802,8 @@ void test_lrint() // Difference in rounding mode at 0.5 if (abs(ret_dec) == abs(ret_val) + 1) { + // LCOV_EXCL_START + float iptr; const auto frac = std::modf(val1, &iptr); if (abs(abs(frac) - 0.5F) < 0.01F) @@ -810,11 +812,11 @@ void test_lrint() } else { - // LCOV_EXCL_START std::cerr << "Frac: " << frac << "\nDist: " << std::fabs(frac - 0.5F) / std::numeric_limits::epsilon() << std::endl; - // LCOV_EXCL_STOP } + + // LCOV_EXCL_STOP } if (!BOOST_TEST_EQ(ret_val, ret_dec))