Page MenuHomePhabricator

Fix off by one errors in the difference fomatter serialize_tests

Authored by Fabien on Jun 3 2022, 18:58.



One of the overflow test added in D11515 is not doing what is expected, due to a couple errors:

  • the MAX_SIZE value is a compact size difference value, so the indexes should increment by MAX_SIZE+1
  • the loop size if off by one
Test Plan
ninja check-bitcoin-serialize_tests

Diff Detail

rABC Bitcoin ABC
Lint Not Applicable
Tests Not Applicable

Event Timeline

Fabien requested review of this revision.Jun 3 2022, 18:58
sdulfari requested changes to this revision.Jun 3 2022, 20:55
sdulfari added a subscriber: sdulfari.
sdulfari added inline comments.
509 ↗(On Diff #33813)

Instead of trusting that this version of the test is correct, is it possible to write this in a way that you copy ss and check that remainder - 1 does not overflow? Basically do what your test plan does, but in the test itself.

This revision now requires changes to proceed.Jun 3 2022, 20:55
This revision is now accepted and ready to land.Jun 3 2022, 21:13