Add test cases for HexStr (std::reverse_iterator and corner cases) #12570

pull kostaz wants to merge 2 commits into bitcoin:master from kostaz:master changing 1 files +66 −0
  1. kostaz commented at 5:35 AM on March 1, 2018: contributor

    No description provided.

  2. Add tests for HexStr corner cases
    Signed-off-by: Kosta Zertsekel <zertsekel@gmail.com>
    90eac8c1f2
  3. Add tests for HexStr std::reverse_iterator cases
    Signed-off-by: Kosta Zertsekel <zertsekel@gmail.com>
    ac48861815
  4. fanquake added the label Tests on Mar 1, 2018
  5. practicalswift commented at 7:18 AM on March 1, 2018: contributor

    utACK ac48861815832e924bc355553f677f54ace984c5

  6. laanwj commented at 10:08 AM on March 1, 2018: member
  7. laanwj merged this on Mar 1, 2018
  8. laanwj closed this on Mar 1, 2018

  9. laanwj referenced this in commit 39dcac27a1 on Mar 1, 2018
  10. in src/test/util_tests.cpp:108 in 90eac8c1f2 outdated
     103 | +        HexStr(ParseHex_expected + sizeof(ParseHex_expected),
     104 | +               ParseHex_expected + sizeof(ParseHex_expected), true),
     105 | +        "");
     106 | +
     107 | +    BOOST_CHECK_EQUAL(
     108 | +        HexStr(ParseHex_expected, ParseHex_expected),
    


    promag commented at 2:01 PM on March 1, 2018:

    This is already tested above (L97-100), where begin == end, or am I missing something? (I prefer this over the above).

  11. in src/test/util_tests.cpp:167 in ac48861815
     162 | +        HexStr(std::reverse_iterator<const uint8_t *>(ParseHex_expected + 5),
     163 | +               std::reverse_iterator<const uint8_t *>(ParseHex_expected), true),
     164 | +        "b0 fd 8a 67 04"
     165 | +    );
     166 | +
     167 | +    BOOST_CHECK_EQUAL(
    


    promag commented at 2:06 PM on March 1, 2018:

    This is already tested in L155-L159.

  12. in src/test/util_tests.cpp:161 in ac48861815
     156 | +        HexStr(std::reverse_iterator<const uint8_t *>(ParseHex_expected + 5),
     157 | +               std::reverse_iterator<const uint8_t *>(ParseHex_expected)),
     158 | +        "b0fd8a6704"
     159 | +    );
     160 | +
     161 | +    BOOST_CHECK_EQUAL(
    


    promag commented at 2:06 PM on March 1, 2018:

    This is already tested in L143-L146.

  13. promag commented at 2:08 PM on March 1, 2018: member

    There are some duplicate tests, which only the "length" changes.

    Post utACK.

  14. PastaPastaPasta referenced this in commit 1affef85d7 on Jun 10, 2020
  15. PastaPastaPasta referenced this in commit 690902e18e on Jun 12, 2020
  16. PastaPastaPasta referenced this in commit fecbd544d2 on Jun 13, 2020
  17. PastaPastaPasta referenced this in commit da1728fe14 on Jun 14, 2020
  18. PastaPastaPasta referenced this in commit c939de0256 on Jun 14, 2020
  19. DrahtBot 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-17 06:15 UTC

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