test: Fix copy-paste in wallet/test/db_tests ostream operator #31038

pull hodlinator wants to merge 1 commits into bitcoin:master from hodlinator:2024/10/db_tests_ostream changing 1 files +1 −1
  1. hodlinator commented at 10:04 pm on October 5, 2024: contributor

    Fix accidentally remaining copy-pasted variable name.

    Example output when intentionally adding expected.erase(expected.begin()); before BOOST_CHECK_EQUAL_COLLECTIONS in db_tests.cpp/CheckPrefix:

    Before fix:

    0src/wallet/test/db_tests.cpp(61): error: in "db_tests/db_cursor_prefix_byte_test": check { actual.begin(), actual.end() } == { expected.begin(), expected.end() } has failed. 
    1Mismatch at position 0: ("�", "�") != ("�suffix", "�suffix")
    2Mismatch at position 1: ("�suffix", "�suffix") != ("��", "��")
    3Mismatch at position 2: ("��", "��") != ("��suffix", "��suffix")
    4Collections size mismatch: 4 != 3
    

    After fix:

    0src/wallet/test/db_tests.cpp(61): error: in "db_tests/db_cursor_prefix_byte_test": check { actual.begin(), actual.end() } == { expected.begin(), expected.end() } has failed. 
    1Mismatch at position 0: ("�", "f") != ("�suffix", "fs")
    2Mismatch at position 1: ("�suffix", "fs") != ("��", "ff")
    3Mismatch at position 2: ("��", "ff") != ("��suffix", "ffs")
    4Collections size mismatch: 4 != 3
    

    Super-minor issue only uncovered when tests fail, but might as well correct it.

  2. test: Fix copy-paste in db_tests ostream operator f50557f5d3
  3. DrahtBot commented at 10:04 pm on October 5, 2024: contributor

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

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK maflcko, tdb3

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #30987 (Don’t zero-after-free DataStream: Faster IBD on some configurations by davidgumberg)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  4. DrahtBot added the label Tests on Oct 5, 2024
  5. in src/wallet/test/db_tests.cpp:29 in f50557f5d3
    27@@ -28,7 +28,7 @@ inline std::ostream& operator<<(std::ostream& os, const std::pair<const Serializ
    28 {
    29     Span key{kv.first}, value{kv.second};
    


    maflcko commented at 8:51 am on October 7, 2024:
    unrelated nit: Could make this string_view to begin with, to avoid going the extra step over Span. This will also make my diff smaller to switch Span to std::span. But just a nit.

    hodlinator commented at 3:44 pm on October 8, 2024:
    Sorry, I wasn’t fast enough.
  6. maflcko approved
  7. maflcko commented at 8:51 am on October 7, 2024: member
    lgtm ACK f50557f5d36f568b7fe65ff5e242303b16b9b258
  8. tdb3 approved
  9. tdb3 commented at 2:24 pm on October 8, 2024: contributor
    code review ACK f50557f5d36f568b7fe65ff5e242303b16b9b258 Good find!
  10. fanquake merged this on Oct 8, 2024
  11. fanquake closed this on Oct 8, 2024

  12. hodlinator deleted the branch on Oct 8, 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-12-26 12:12 UTC

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