test: Remove last uses of snprintf and simplify #27036

pull john-moffett wants to merge 1 commits into bitcoin:master from john-moffett:2023_02_FixDBWrapperTest changing 2 files +14 −30
  1. john-moffett commented at 4:48 pm on February 3, 2023: contributor

    These are the only remaining uses of snprintf in our project, and they can cause unexpected issues – for example, see #27014. Change them to use our ToString (which uses a locale-independent version of std::to_string) to convert an int to std::string. Also remove resulting unused parts of StringContentsSerializer.

    Closes https://github.com/bitcoin/bitcoin/issues/27014

  2. DrahtBot commented at 4:48 pm on February 3, 2023: contributor

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK Sjors
    Concept ACK jonatack, brunoerg

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. DrahtBot added the label Tests on Feb 3, 2023
  4. Remove use of snprintf and simplify
    One test case uses snprintf to convert an
    int to a string. Change it to use ToString
    (which uses a locale-independent version of
    std::to_string). Also remove unnecessary
    parts of StringContentsSerializer.
    b8032293e6
  5. john-moffett force-pushed on Feb 3, 2023
  6. jonatack commented at 6:04 pm on February 3, 2023: contributor
    Concept ACK. Maybe verify if the linter files need updating (test/lint/lint-locale-dependence.py?)
  7. john-moffett commented at 6:07 pm on February 3, 2023: contributor

    Maybe verify if the linter files need updating (test/lint/lint-locale-dependence.py?)

    Thanks! Pushed that change about a half hour ago. You were too quick 😄

  8. brunoerg commented at 8:38 pm on February 3, 2023: contributor
    Concept ACK
  9. Sjors commented at 9:17 am on February 6, 2023: member
    tACK b8032293e67a3b61ecad531412be5330f7cb39e3, fixes #27014.
  10. maflcko merged this on Feb 6, 2023
  11. maflcko closed this on Feb 6, 2023

  12. sidhujag referenced this in commit 5dc32bdc36 on Feb 6, 2023
  13. fanquake referenced this in commit bc35c4f58c on Feb 17, 2023
  14. sidhujag referenced this in commit ef111be3dd on Feb 17, 2023
  15. bitcoin locked this on Feb 6, 2024

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: 2024-06-29 10:13 UTC

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