[tests] Remove printf(...) #10524

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:u-for-unsigned-int changing 1 files +0 −2
  1. practicalswift commented at 11:31 PM on June 3, 2017: contributor

    No description provided.

  2. fanquake added the label Tests on Jun 4, 2017
  3. practicalswift renamed this:
    Fix incorrect format strings
    [tests] Fix incorrect format strings
    on Jun 4, 2017
  4. sipa commented at 6:25 PM on June 4, 2017: member

    These should just be changed to use LogPrintf (or nothing at all, it's debug code!) instead of printf.

    Historically, printf was a macro in the codebase that invoked the logging code. Since then we have 1) switched to tinyformat (where %d is legal for unsigned values) and 2) replaced the printf calls with LogPrintf. It seems these two are somehow copied from an old version of the code.

  5. practicalswift force-pushed on Jun 4, 2017
  6. practicalswift commented at 6:41 PM on June 4, 2017: contributor

    @sipa Thanks for the review!

    Turns out that these two were the last remaining instances of printf:

    $ git grep "[^a-z]printf(" -- "*.cpp" "*.h" | egrep -v "(univalue|tinyformat|secp256k1)"
    src/test/sighash_tests.cpp:        printf("ERROR: SignatureHash(): nIn=%d out of range\n", nIn);
    src/test/sighash_tests.cpp:            printf("ERROR: SignatureHash(): nOut=%d out of range\n", nOut);
    

    Looks good now?

  7. practicalswift force-pushed on Jun 4, 2017
  8. practicalswift renamed this:
    [tests] Fix incorrect format strings
    tests] Use LogPrintf(...) instead of printf(...)
    on Jun 4, 2017
  9. practicalswift renamed this:
    tests] Use LogPrintf(...) instead of printf(...)
    [tests] Use LogPrintf(...) instead of printf(...)
    on Jun 4, 2017
  10. laanwj commented at 12:53 PM on June 5, 2017: member

    The logging output of the tests is ignored, I don't think there's any flag to show/store it (at least with printf they still did something, print to stdout). So I think it'd be better to just remove these lines then?

  11. MarcoFalke commented at 5:16 PM on June 5, 2017: member

    As they indicate an error, the alternative would be to replace them with BOOST_CHECK_MESSAGE, which also works with the operator<<

  12. laanwj commented at 10:12 AM on June 6, 2017: member

    As they indicate an error

    Sure, though I guess if it fails, I'd hope the test will fail later on anyhow because of the return value.

  13. [tests] Remove printf(...) 0abc58890c
  14. practicalswift force-pushed on Jun 7, 2017
  15. practicalswift commented at 6:43 PM on June 7, 2017: contributor

    PR updated. Now simply removing the printf(…):s :-)

  16. sipa commented at 6:56 PM on June 7, 2017: member

    utACK 0abc58890c1a6600fa5097603febd3990a071d03

  17. laanwj renamed this:
    [tests] Use LogPrintf(...) instead of printf(...)
    [tests] Remove printf(...)
    on Jun 8, 2017
  18. laanwj merged this on Jun 8, 2017
  19. laanwj closed this on Jun 8, 2017

  20. laanwj referenced this in commit 6c2d81f34d on Jun 8, 2017
  21. jasonbcox referenced this in commit f1c98bdf36 on Jun 13, 2019
  22. jtoomim referenced this in commit 6a476a666a on Jun 29, 2019
  23. jonspock referenced this in commit 773a162132 on Jul 4, 2019
  24. jonspock referenced this in commit 2c1056d027 on Jul 4, 2019
  25. PastaPastaPasta referenced this in commit 29f3b6b624 on Jul 5, 2019
  26. proteanx referenced this in commit 4d52f0671d on Jul 5, 2019
  27. PastaPastaPasta referenced this in commit 4504e0e310 on Jul 5, 2019
  28. PastaPastaPasta referenced this in commit 7602da3104 on Jul 6, 2019
  29. PastaPastaPasta referenced this in commit 20e30fb93c on Jul 8, 2019
  30. jonspock referenced this in commit 0b4a16fa7a on Jul 9, 2019
  31. barrystyle referenced this in commit dfbe6ce797 on Jan 22, 2020
  32. practicalswift deleted the branch on Apr 10, 2021
  33. DrahtBot locked this on Aug 18, 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-04-16 15:15 UTC

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