ParseByteUnits() is the only parsing function in strencodings.cpp lacking a fuzz test. Add a test case to check the function against arbitrary strings and randomized default_multiplier.
fuzz: Add a test case for `ParseByteUnits()` #34017
pull Chand-ra wants to merge 1 commits into bitcoin:master from Chand-ra:parseByteUnits changing 1 files +15 −0-
Chand-ra commented at 3:39 PM on December 5, 2025: none
-
57b888ce0e
fuzz: Add a test case for `ParseByteUnits()`
`ParseByteUnits()` is the only parsing function in `strencodings.cpp` lacking a fuzz test. Add a test case to check the function against arbitrary strings and randomized default_multiplier's.
- DrahtBot added the label Tests on Dec 5, 2025
-
DrahtBot commented at 3:39 PM on December 5, 2025: 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/34017.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline for information on the review process.
Type Reviewers ACK dergoegge, marcofleon, maflcko If your review is incorrectly listed, please copy-paste <code><!--meta-tag:bot-skip--></code> into the comment that the bot should ignore.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
- dergoegge approved
-
dergoegge commented at 4:04 PM on December 5, 2025: member
utACK 57b888ce0ebdeb34d866fd1511052fd740cc5ab8
Thank you for your interest in contributing to our fuzzing efforts! This looks fine to me.
ParseByteUnitsis not publicly exposed, i.e. it doesn't handle untrusted inputs, and I would not consider adding fuzz tests for this type of function as a priority. As the in-repo fuzz tests are pretty saturated, it can be hard to spot valuable areas to improve (especially if you are new to the code base). A good path for making valuable contributions is to review other fuzzing PRs (e.g. #31533 or #33300). - fanquake added the label Fuzzing on Dec 5, 2025
- fanquake requested review from marcofleon on Dec 5, 2025
-
marcofleon commented at 5:32 PM on December 5, 2025: contributor
crACK 57b888ce0ebdeb34d866fd1511052fd740cc5ab8
Ran it for a bit as a sanity check, seems fine.
-
Chand-ra commented at 8:08 AM on December 6, 2025: none
ParseByteUnitsis not publicly exposed, i.e. it doesn't handle untrusted inputs, and I would not consider adding fuzz tests for this type of function as a priority.Makes perfect sense. But I wonder why fuzz tests for these internal utilities (like
ToUpper(),ToLower(), etc.) were introduced in the first place? Is it being thorough just for the sake for being thorough?As the in-repo fuzz tests are pretty saturated, it can be hard to spot valuable areas to improve (especially if you are new to the code base). A good path for making valuable contributions is to review other fuzzing PRs (e.g. #31533 or #33300).
Will do!
-
maflcko commented at 9:41 AM on December 6, 2025: member
lgtm ACK 57b888ce0ebdeb34d866fd1511052fd740cc5ab8
- fanquake merged this on Dec 6, 2025
- fanquake closed this on Dec 6, 2025