tests: Add fuzzing harness for functions/classes in flatfile.h, merkleblock.h, random.h, serialize.h and span.h #18455

pull practicalswift wants to merge 5 commits into bitcoin:master from practicalswift:fuzzers-misc-4 changing 8 files +208 −9
  1. practicalswift commented at 9:48 AM on March 28, 2020: contributor
    • Add fuzzing harness for functions/classes in flatfile.h
    • Add fuzzing harness for functions/classes in merkleblock.h
    • Add fuzzing harness for functions/classes in span.h
    • Add fuzzing harness for LimitedString (serialize.h)
    • Add fuzzing harness for functions/classes in random.h
  2. fanquake added the label Tests on Mar 28, 2020
  3. in src/test/fuzz/flatfile.cpp:26 in fd8a97c6ad outdated
      21 | +        return;
      22 | +    }
      23 | +    Optional<FlatFilePos> another_flat_file_pos = ConsumeDeserializable<FlatFilePos>(fuzzed_data_provider);
      24 | +    if (another_flat_file_pos) {
      25 | +        (void)(*flat_file_pos == *another_flat_file_pos);
      26 | +        (void)(*flat_file_pos != *another_flat_file_pos);
    


    MarcoFalke commented at 1:16 PM on March 28, 2020:
            assert((*flat_file_pos == *another_flat_file_pos) != (*flat_file_pos != *another_flat_file_pos));
    

    practicalswift commented at 1:21 PM on March 29, 2020:

    Good idea! Fixed!

  4. in src/test/fuzz/span.cpp:36 in fd8a97c6ad outdated
      31 | +    }
      32 | +
      33 | +    std::string another_str = fuzzed_data_provider.ConsumeBytesAsString(32);
      34 | +    const Span<const char> another_span = MakeSpan(another_str);
      35 | +    (void)(span == another_span);
      36 | +    (void)(span != another_span);
    


    MarcoFalke commented at 1:19 PM on March 28, 2020:

    Same here

  5. in src/test/fuzz/span.cpp:40 in fd8a97c6ad outdated
      35 | +    (void)(span == another_span);
      36 | +    (void)(span != another_span);
      37 | +    (void)(span < another_span);
      38 | +    (void)(span <= another_span);
      39 | +    (void)(span > another_span);
      40 | +    (void)(span >= another_span);
    


    MarcoFalke commented at 1:19 PM on March 28, 2020:
        assert((span >= another_span) != (span < another_span));
    
  6. MarcoFalke approved
  7. tests: Add fuzzing harness for functions/classes in flatfile.h a16ea051f9
  8. tests: Add fuzzing harness for functions/classes in merkleblock.h 9718f38f54
  9. tests: Add fuzzing harness for functions/classes in span.h f205cf7fef
  10. tests: Add fuzzing harness for LimitedString (serialize.h) 64d277bbbc
  11. tests: Add fuzzing harness for functions/classes in random.h 11a520f679
  12. practicalswift force-pushed on Mar 29, 2020
  13. practicalswift commented at 1:21 PM on March 29, 2020: contributor

    @MarcoFalke Thanks for nice suggestions. Now implemented. Please re-review :)

  14. MarcoFalke merged this on Mar 29, 2020
  15. MarcoFalke closed this on Mar 29, 2020

  16. sidhujag referenced this in commit 01e0df58da on Mar 29, 2020
  17. Fabcien referenced this in commit 21dba1639a on Jan 20, 2021
  18. practicalswift deleted the branch on Apr 10, 2021
  19. kittywhiskers referenced this in commit 8514e39ce2 on May 7, 2022
  20. kittywhiskers referenced this in commit fb8b7e635f on May 7, 2022
  21. kittywhiskers referenced this in commit b7b0033059 on Jun 14, 2022
  22. kittywhiskers referenced this in commit 8bd9e756c8 on Jun 14, 2022
  23. kittywhiskers referenced this in commit 552cb542bb on Jun 18, 2022
  24. kittywhiskers referenced this in commit 3c7e9835c0 on Jul 4, 2022
  25. kittywhiskers referenced this in commit c9589de1b2 on Jul 4, 2022
  26. kittywhiskers referenced this in commit 1eed917681 on Jul 6, 2022
  27. kittywhiskers referenced this in commit ee7e37ae01 on Jul 6, 2022
  28. PastaPastaPasta referenced this in commit eefdae1a53 on Jul 12, 2022
  29. knst referenced this in commit bc29bdceba on Jul 21, 2022
  30. DrahtBot locked this on Aug 16, 2022
Labels

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-16 15:14 UTC

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