-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix output precision in WithinRelMatcher #2846
Conversation
If this is changed to pass tests, I am willing to merge it. |
What sort of tests do you have in mind? |
Well, right now the change does not pass CI because of the output format change. See contributing.md for how to run the tests locally. |
I see - this breaks quite a few tests. |
I tried to fix the tests, but the tests are failing on my machine. I tried to run on my (Apple M1) machine:
This fails:
and then a bunch of other tests fail:
|
Oh right, the warning issue in #2845. I should have that fixed in a bit. |
Done. The build on M1 mac should no longer cause warning and thus fail due to Werror. |
I think I have fixed the tests, waiting on the tests to run to be sure. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## devel #2846 +/- ##
=======================================
Coverage 91.09% 91.09%
=======================================
Files 197 197
Lines 8382 8382
=======================================
Hits 7635 7635
Misses 747 747 |
Ready for merge I think |
Yep, thanks. |
Description
The WithinRelMatcher does not listen to the precision specification; it just naively pipes to stringstream. If you specify the precision, that has no impact on the outputted values when the match fails.
This fix makes the WithinRelMatcher listen to the precision (https://github.com/catchorg/Catch2/blob/devel/docs/tostring.md#floating-point-precision) specified by:
Catch::StringMaker<float>::precision