Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#31038: test: Fix copy-paste in wallet/test/db_t…
Browse files Browse the repository at this point in the history
…ests ostream operator

f50557f test: Fix copy-paste in db_tests ostream operator (Hodlinator)

Pull request description:

  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:
  ```
  src/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.
  Mismatch at position 0: ("�", "�") != ("�suffix", "�suffix")
  Mismatch at position 1: ("�suffix", "�suffix") != ("��", "��")
  Mismatch at position 2: ("��", "��") != ("��suffix", "��suffix")
  Collections size mismatch: 4 != 3
  ```

  After fix:
  ```
  src/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.
  Mismatch at position 0: ("�", "f") != ("�suffix", "fs")
  Mismatch at position 1: ("�suffix", "fs") != ("��", "ff")
  Mismatch at position 2: ("��", "ff") != ("��suffix", "ffs")
  Collections size mismatch: 4 != 3
  ```

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

ACKs for top commit:
  maflcko:
    lgtm ACK f50557f
  tdb3:
    code review ACK f50557f

Tree-SHA512: d36e9bc36f82f2c39e9c7585ae9e5c63f7fd07665d1d3c625709bc90168ced2f83ac7d577b4914dae2f0f101c415bf0c1ed6de98a20c96c8c0383a701cbdbe99
  • Loading branch information
fanquake committed Oct 8, 2024
2 parents 3fecf36 + f50557f commit bb47b5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wallet/test/db_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ inline std::ostream& operator<<(std::ostream& os, const std::pair<const Serializ
{
Span key{kv.first}, value{kv.second};
os << "(\"" << std::string_view{reinterpret_cast<const char*>(key.data()), key.size()} << "\", \""
<< std::string_view{reinterpret_cast<const char*>(key.data()), key.size()} << "\")";
<< std::string_view{reinterpret_cast<const char*>(value.data()), value.size()} << "\")";
return os;
}

Expand Down

0 comments on commit bb47b5a

Please sign in to comment.