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 ) :

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

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

    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. practicalswift referenced this in commit faedda76fe on Dec 15, 2018
  15. practicalswift referenced this in commit c07910b184 on Dec 15, 2018
  16. Empact referenced this in commit 31a0ecfd3c on Dec 15, 2018
  17. practicalswift referenced this in commit d98a29ec40 on Dec 15, 2018
  18. laanwj referenced this in commit 3424171685 on Dec 16, 2018
  19. benthecarman referenced this in commit f806fb226a on Dec 17, 2018
  20. HashUnlimited referenced this in commit e1a0f50433 on Dec 18, 2018
  21. kallewoof referenced this in commit 66c015529e on Oct 4, 2019
  22. deadalnix referenced this in commit a06ba8d57a on Jun 22, 2020
  23. practicalswift deleted the branch on Apr 10, 2021
  24. dzutto referenced this in commit f339f3de57 on Sep 24, 2021
  25. dzutto referenced this in commit 9d408b364a on Sep 24, 2021
  26. dzutto referenced this in commit eb0a3d833d on Sep 24, 2021
  27. dzutto referenced this in commit e14e759068 on Sep 27, 2021
  28. dzutto referenced this in commit 298a64983f on Sep 27, 2021
  29. dzutto referenced this in commit e7d6c49249 on Sep 30, 2021
  30. dzutto referenced this in commit 6e91a22d80 on Sep 30, 2021
  31. UdjinM6 referenced this in commit 4c72a1a975 on Oct 1, 2021
  32. kittywhiskers referenced this in commit 8ed5b34f52 on Oct 12, 2021
  33. kittywhiskers referenced this in commit 1983b3602d on Oct 12, 2021
  34. 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: 2024-10-05 01:12 UTC

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