test: Fix sign for expected values #12920

pull kallewoof wants to merge 1 commits into bitcoin:master from kallewoof:test-signs changing 20 files +146 −146
  1. kallewoof commented at 7:52 am on April 9, 2018: member

    A number of BOOST_CHECK_EQUAL calls would result in warnings about signs.

    This PR fixes signedness for all expectation values, sometimes resulting in intunsigned int. No other code changes besides adding/removing U to/from values.

    Running make &> make_output_... on master versus on this PR:

    0$ wc make_output_*
    1    1464    5925   90357 make_output_master
    2     613    1469   28370 make_output_signfixed
    

    More than halves the output lines from compiling.

  2. fanquake added the label Tests on Apr 9, 2018
  3. practicalswift commented at 8:39 am on April 9, 2018: contributor
    utACK 08f99ecf30ff994e57045ed633c0ab4e61f01ea6
  4. MarcoFalke commented at 11:53 am on April 9, 2018: member
    What tool have you used to see the warnings?
  5. kallewoof commented at 2:26 pm on April 9, 2018: member

    @MarcoFalke macOS clang (g++)

    To clarify, these warnings show up when compiling bitcoin. It’s not some obscure linter somewhere.

  6. kallewoof commented at 6:44 am on April 10, 2018: member

    Running make &> make_output_... on master versus on this PR:

    0$ wc make_output_*
    1    1464    5925   90357 make_output_master
    2     613    1469   28370 make_output_signfixed
    

    More than halves the output lines from compiling.

  7. in src/test/coins_tests.cpp:484 in 08f99ecf30 outdated
    479@@ -480,16 +480,16 @@ BOOST_AUTO_TEST_CASE(ccoins_serialization)
    480     Coin cc1;
    481     ss1 >> cc1;
    482     BOOST_CHECK_EQUAL(cc1.fCoinBase, false);
    483-    BOOST_CHECK_EQUAL(cc1.nHeight, 203998);
    484-    BOOST_CHECK_EQUAL(cc1.out.nValue, 60000000000ULL);
    485+    BOOST_CHECK_EQUAL(cc1.nHeight, 203998U);
    486+    BOOST_CHECK_EQUAL(cc1.out.nValue, 60000000000LL);
    


    MarcoFalke commented at 3:43 pm on April 10, 2018:
    nit: I think CAmount{60000000000} works as well
  8. in src/test/main_tests.cpp:58 in 08f99ecf30 outdated
    54@@ -55,7 +55,7 @@ BOOST_AUTO_TEST_CASE(subsidy_limit_test)
    55         nSum += nSubsidy * 1000;
    56         BOOST_CHECK(MoneyRange(nSum));
    57     }
    58-    BOOST_CHECK_EQUAL(nSum, 2099999997690000ULL);
    59+    BOOST_CHECK_EQUAL(nSum, 2099999997690000LL);
    


    MarcoFalke commented at 3:46 pm on April 10, 2018:
    nit: Same here CAmount{2099999997690000}
  9. MarcoFalke commented at 3:49 pm on April 10, 2018: member
    utACK 08f99ecf30ff994e57045ed633c0ab4e61f01ea6
  10. test: Fix sign for expected values
    A number of BOOST_CHECK_EQUAL calls would result in warnings about signs.
    c55aa4f27d
  11. kallewoof force-pushed on Apr 11, 2018
  12. kallewoof commented at 4:40 am on April 11, 2018: member
    Switched to CAmount{} according to @MarcoFalke nits.
  13. jonasschnelli commented at 8:15 am on April 11, 2018: contributor
    Tested ACK c55aa4f27d4fcb1d179fb1b17034476a5918ea85 (fixed my new boost::test warnings on macOS 10.12)
  14. MarcoFalke commented at 11:53 am on April 11, 2018: member
    re-utACK c55aa4f27d
  15. laanwj merged this on Apr 11, 2018
  16. laanwj closed this on Apr 11, 2018

  17. laanwj referenced this in commit b1fdfc1a8c on Apr 11, 2018
  18. jasonbcox referenced this in commit acc1dbbebd on Sep 27, 2019
  19. kallewoof deleted the branch on Oct 17, 2019
  20. jasonbcox referenced this in commit eb8ed1fc66 on Dec 6, 2019
  21. PastaPastaPasta referenced this in commit 57a4163a52 on Apr 13, 2021
  22. PastaPastaPasta referenced this in commit 79da39ae76 on Apr 17, 2021
  23. kittywhiskers referenced this in commit edf1051e22 on Apr 23, 2021
  24. DrahtBot locked this on Dec 16, 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: 2024-11-17 06:12 UTC

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