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
  1. Chand-ra commented at 3:39 pm on December 5, 2025: none
    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.
  2. 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.
    57b888ce0e
  3. DrahtBot added the label Tests on Dec 5, 2025
  4. DrahtBot commented at 3:39 pm on December 5, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34017.

    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 <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  5. dergoegge approved
  6. 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.

    ParseByteUnits is 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).

  7. fanquake added the label Fuzzing on Dec 5, 2025
  8. fanquake requested review from marcofleon on Dec 5, 2025
  9. marcofleon commented at 5:32 pm on December 5, 2025: contributor

    crACK 57b888ce0ebdeb34d866fd1511052fd740cc5ab8

    Ran it for a bit as a sanity check, seems fine.

  10. Chand-ra commented at 8:08 am on December 6, 2025: none

    ParseByteUnits is 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!

  11. maflcko commented at 9:41 am on December 6, 2025: member
    lgtm ACK 57b888ce0ebdeb34d866fd1511052fd740cc5ab8
  12. fanquake merged this on Dec 6, 2025
  13. fanquake closed this on Dec 6, 2025


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-12-11 15:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me