max_cache is known ahead of time in this test as a size_t of 10000, and each of these calculations should be known ahead of time (500.0, 9500.0). This test can truncate the double and assert exact equality rather than use a tolerance. Found in #35713 whereby this is the only use of this macro in the unit tests. IMO it is appropriate to tighten this test and remove the macro.
test: Remove `BOOST_CHECK_CLOSE` in favor of exact comparison #36067
pull rustaceanrob wants to merge 1 commits into bitcoin:master from rustaceanrob:26-8-24-close-check changing 1 files +4 −4-
rustaceanrob commented at 1:29 PM on August 24, 2026: member
-
9e115edd39
test: Remove `BOOST_CHECK_CLOSE` in favor of exact comparison
`max_cache` is known ahead of time in this test as a `size_t` of `10000`, and each of these calculations should be known ahead of time (500.0, 9500.0). This test can truncate the double and assert exact equality rather than use a tolerance.
- DrahtBot added the label Tests on Aug 24, 2026
-
DrahtBot commented at 1:29 PM on August 24, 2026: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
Code Coverage & Benchmarks
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36067.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste <code><!--meta-tag:bot-skip--></code> into the comment that the bot should ignore.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
-
maflcko commented at 1:55 PM on August 24, 2026: member
lgtm ACK 9e115edd39ffffa81b0b2a7eafada44ecf01c057
-
josibake commented at 2:42 PM on August 24, 2026: member
- fanquake merged this on Aug 24, 2026
- fanquake closed this on Aug 24, 2026
-
l0rinc commented at 3:39 AM on August 25, 2026: contributor
Post-merge ACK
The exact integer comparison matches the
size_tconversion inMaybeRebalanceCaches().Not sure how useful these tests are, or the custom sizing in general (since I have a pending PR completely removing them, but the benchmarks are a bit all over the place, so I postponed pushing it), but the PR simplifies what we had.
- rustaceanrob deleted the branch on Aug 25, 2026