test: add ParseUInt16() unit test and fuzz coverage #21488

pull jonatack wants to merge 1 commits into bitcoin:master from jonatack:ParseUInt16-test-coverage changing 2 files +39 −0
  1. jonatack commented at 7:45 PM on March 20, 2021: contributor

    ParseUInt16() was just added in #21328.

  2. test: add ParseUInt16() test coverage 3d086f42ab
  3. DrahtBot added the label Tests on Mar 20, 2021
  4. practicalswift commented at 9:22 PM on March 20, 2021: contributor

    cr ACK 3d086f42ab58f0f5984101d5285d5a707e3dc8e7: patch looks correct & more coverage is better than less coverage

  5. MarcoFalke merged this on Mar 21, 2021
  6. MarcoFalke closed this on Mar 21, 2021

  7. in src/test/util_tests.cpp:1552 in 3d086f42ab
    1547 | +    BOOST_CHECK(!ParseUInt16("-1", &n));
    1548 | +    BOOST_CHECK(!ParseUInt16("1 ", &n));
    1549 | +    BOOST_CHECK(!ParseUInt16("1a", &n));
    1550 | +    BOOST_CHECK(!ParseUInt16("aap", &n));
    1551 | +    BOOST_CHECK(!ParseUInt16("0x1", &n)); // no hex
    1552 | +    BOOST_CHECK(!ParseUInt16("0x1", &n)); // no hex
    


    kiminuo commented at 9:16 AM on March 21, 2021:

    These two lines look the same to me.


    jonatack commented at 10:18 AM on March 21, 2021:

    Thanks! Fixed in #21491, co-crediting you

  8. jonatack deleted the branch on Mar 21, 2021
  9. jonatack cross-referenced this on Mar 21, 2021 from issue test: remove duplicate assertions in util_tests by jonatack
  10. sidhujag referenced this in commit fc65f9795d on Mar 21, 2021
  11. fanquake referenced this in commit 80cb51cc6b on Mar 22, 2021
  12. sidhujag referenced this in commit 495322941e on Mar 22, 2021
  13. Fabcien referenced this in commit c38178957a on Feb 21, 2022
  14. bitcoin locked this on Aug 16, 2022

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-05-20 06:54 UTC