tests: add varints_bitpatterns test #7849

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2016_04_varint_bit_pattern_tests changing 1 files +21 −0
  1. laanwj commented at 7:14 AM on April 9, 2016: member

    The current tests for varint only check that serialization-deserialization is a roundtrip. That is a useful test, but it is also good to check for some exact bit patterns, to prevent a code change that changes the serialization format from going undetected (or a similar incompatibility between platforms).

    As the varint functions are templated, also check with different types.

    I wrote this test in the course of diagnosing #7848 and everything turned out to be good, but it makes sense anyhow.

  2. laanwj added the label Tests on Apr 9, 2016
  3. tests: add varints_bitpatterns test
    The current tests for varint only check that
    serialization-deserialization is a roundtrip. That is a useful test, but
    it is also good to check for some exact bit patterns, to prevent a code
    change that changes the serialization format from going undetected.
    
    As the varint functions are templated, also check with different types.
    4521f005a1
  4. laanwj force-pushed on Apr 9, 2016
  5. MarcoFalke commented at 10:40 AM on April 9, 2016: member

    Indeed, makes sense. Concept ACK.

  6. jonasschnelli commented at 1:58 PM on April 11, 2016: contributor

    ACK 4521f005a1e61969f21b91a7e8eef5a5cdfdd191. More tests are always good.

  7. sipa commented at 1:55 PM on April 12, 2016: member

    utACK 4521f005a1e61969f21b91a7e8eef5a5cdfdd191

  8. laanwj merged this on Apr 14, 2016
  9. laanwj closed this on Apr 14, 2016

  10. laanwj referenced this in commit ab8586e667 on Apr 14, 2016
  11. codablock referenced this in commit 73f08fe002 on Sep 16, 2017
  12. codablock referenced this in commit addbe2be2b on Sep 19, 2017
  13. codablock referenced this in commit 116b14b5f0 on Dec 20, 2017
  14. MarcoFalke locked this on Sep 8, 2021

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: 2026-04-13 15:15 UTC

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