tests: Test for expected return values when calling functions returning a success code #14935

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:test-return-values changing 16 files +161 −161
  1. practicalswift commented at 1:43 PM on December 12, 2018: contributor

    Test for expected return values when calling functions returning a success code (instead of discarding the return values).

    Note to reviewers: The following commands can be used to verify that the only text fragments added in this PR are BOOST_CHECK(, ! and ) :

    $ git diff HEAD~1 | grep -E '^[\-][^\-]' | cut -b2- > before.txt
    $ git diff HEAD~1 | grep -E '^[\+][^\+]' | cut -b2- > after.txt
    $ cat after.txt | sed 's/BOOST_CHECK(//g' | sed 's/));/);/g' | tr -d '!' > after-sed.txt
    $ diff -u before.txt after-sed.txt
    $ 
    
  2. fanquake added the label Tests on Dec 12, 2018
  3. DrahtBot commented at 3:59 PM on December 12, 2018: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #14908 (test: Removed implicit CTransaction constructor calls from tests and benchmarks. by lucash-dev)
    • #14906 (refactor: Make explicit CMutableTransaction -> CTransaction conversion. by lucash-dev)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  4. DrahtBot added the label Needs rebase on Dec 12, 2018
  5. tests: Test for expected return values when calling functions returning a success code c84c2b8c92
  6. practicalswift commented at 8:38 AM on December 13, 2018: contributor

    Rebased!

  7. practicalswift force-pushed on Dec 13, 2018
  8. DrahtBot removed the label Needs rebase on Dec 13, 2018
  9. laanwj commented at 11:18 AM on December 13, 2018: member

    Agree that this improves the tests; ignoring return status is careless.

    utACK c84c2b8c92eb56b3b3793fc95265158f5eeb00db

  10. MarcoFalke merged this on Dec 14, 2018
  11. MarcoFalke closed this on Dec 14, 2018

  12. MarcoFalke referenced this in commit 9133227298 on Dec 14, 2018
  13. in src/test/checkqueue_tests.cpp:358 in c84c2b8c92
     354 | @@ -355,7 +355,7 @@ BOOST_AUTO_TEST_CASE(test_CheckQueue_FrozenCleanup)
     355 |          // would get called twice).
     356 |          vChecks[0].should_freeze = true;
     357 |          control.Add(vChecks);
     358 | -        control.Wait(); // Hangs here
     359 | +        BOOST_CHECK(control.Wait()); // Hangs here
    


    MarcoFalke commented at 7:28 PM on December 14, 2018:

    BOOST_CHECK is not thread safe, but it should be fine in this case.


    MarcoFalke commented at 10:40 PM on December 14, 2018:

    Oh well. I think the thread sanitizer yells at this. Mind fixing it up?


    practicalswift commented at 3:21 PM on December 15, 2018:

    @MarcoFalke Sure! Fixed in #14969. Thanks for the ping :-)

  14. fanquake cross-referenced this on Dec 15, 2018 from issue TSAN issue in cuckoocache_erase_parallel_ok test after 14935 by fanquake
  15. practicalswift referenced this in commit faedda76fe on Dec 15, 2018
  16. practicalswift referenced this in commit c07910b184 on Dec 15, 2018
  17. practicalswift cross-referenced this on Dec 15, 2018 from issue tests: Fix cuckoocache_tests TSAN failure introduced in 14935. by practicalswift
  18. Empact referenced this in commit 31a0ecfd3c on Dec 15, 2018
  19. practicalswift referenced this in commit d98a29ec40 on Dec 15, 2018
  20. laanwj referenced this in commit 3424171685 on Dec 16, 2018
  21. benthecarman referenced this in commit f806fb226a on Dec 17, 2018
  22. HashUnlimited referenced this in commit e1a0f50433 on Dec 18, 2018
  23. kallewoof referenced this in commit 66c015529e on Oct 4, 2019
  24. deadalnix referenced this in commit a06ba8d57a on Jun 22, 2020
  25. practicalswift deleted the branch on Apr 10, 2021
  26. dzutto referenced this in commit f339f3de57 on Sep 24, 2021
  27. dzutto referenced this in commit 9d408b364a on Sep 24, 2021
  28. dzutto referenced this in commit eb0a3d833d on Sep 24, 2021
  29. dzutto cross-referenced this on Sep 25, 2021 from issue Merge 0.18 PRs: #14268, #15408, #14094, #14935 and #14969 by dzutto
  30. dzutto referenced this in commit e14e759068 on Sep 27, 2021
  31. dzutto referenced this in commit 298a64983f on Sep 27, 2021
  32. dzutto referenced this in commit e7d6c49249 on Sep 30, 2021
  33. dzutto referenced this in commit 6e91a22d80 on Sep 30, 2021
  34. UdjinM6 referenced this in commit 4c72a1a975 on Oct 1, 2021
  35. barton2526 cross-referenced this on Oct 8, 2021 from issue test: Update script_p2sh_tests from upstream by barton2526
  36. kwvg referenced this in commit 8ed5b34f52 on Oct 12, 2021
  37. kwvg referenced this in commit 1983b3602d on Oct 12, 2021
  38. barton2526 cross-referenced this on Mar 9, 2022 from issue test: Test for expected return values when calling functions returning a success code by barton2526
  39. bitcoin 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-05-20 06:54 UTC