Skip to content

Conversation

@mborland
Copy link
Member

Closes: #802

#include <boost/core/lightweight_test.hpp>
#include <iostream>

void fasting()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure adding this as test is useful.
Result was always correct afaik.
This is hard to test but if you want one way to test this is to introduce detail:: helper that checks if 2 numbers can be multiplied within range of u128, and then test that helper.
Might be an overkill, but it is basically just extracting

    const auto lhs_dig {detail::num_digits(lhs_sig)};
    const auto rhs_dig {detail::num_digits(rhs_sig)};
    return lhs_dig + rhs_dig <= std::numeric_limits<uint128>::digits10;
    

into bool returning helper function.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good reproducer for using the debugger. I'm not super worried about the test in this case since the special functions test suites will for sure hit both paths.

@codecov
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.9%. Comparing base (30ed86c) to head (35ada3d).
Report is 3 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop    #812     +/-   ##
=========================================
+ Coverage     98.9%   98.9%   +0.1%     
=========================================
  Files          228     229      +1     
  Lines        16978   16987      +9     
  Branches      1810    1809      -1     
=========================================
+ Hits         16787   16796      +9     
  Misses         191     191             
Files with missing lines Coverage Δ
include/boost/decimal/detail/mul_impl.hpp 94.9% <100.0%> (ø)
test/github_issue_802.cpp 100.0% <100.0%> (ø)

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 30ed86c...35ada3d. Read the comment docs.

@mborland mborland merged commit 9bcc0d2 into develop Jan 21, 2025
75 checks passed
@mborland mborland deleted the 802 branch January 21, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect result range check in d128_mul_impl

3 participants