Tests: IsReachable is the inverse of IsLimited (DRY). Includes unit tests #15051

pull mmachicao wants to merge 1 commits into bitcoin:master from mmachicao:net_contract_test2 changing 2 files +91 −4
  1. mmachicao commented at 3:33 PM on December 28, 2018: contributor

    IsReachable is the inverse of IsLimited, but the implementation is duplicated (DRY)

    • Changed the implementation accordingly.
    • Added unit tests to document behavior and relationship
    • My modification in net.cpp applies only to IsReachable.
    • Applied clang-format-diffpy

    Created new pull request to avoid the mess with: #15044

    Checked with supposedly conflicting PRs mentioned in the old PR. No conflicts with the specific changes in this PR.

  2. IsReachable is the inverse of IsLimited (DRY). Includes unit tests 6dc4593db1
  3. fanquake added the label Tests on Dec 28, 2018
  4. Empact commented at 11:22 PM on December 30, 2018: member

    utACK 6dc4593

  5. in src/test/net_tests.cpp:277 in 6dc4593db1
     272 | +
     273 | +    BOOST_CHECK_EQUAL(IsReachable(NET_UNROUTABLE), true);
     274 | +    BOOST_CHECK_EQUAL(IsReachable(NET_INTERNAL), true);
     275 | +}
     276 | +
     277 | +CNetAddr UtilBuildAddress(unsigned char p1, unsigned char p2, unsigned char p3, unsigned char p4)
    


    promag commented at 1:04 AM on December 31, 2018:

    nit, static.

  6. promag commented at 1:08 AM on December 31, 2018: member

    utACK 6dc4593.

    another nit, could have separate commits.

  7. laanwj commented at 3:14 PM on January 2, 2019: member

    I thought they were different. Did this change at some point? In any case with the current code this looks correct. utACK.

  8. Empact commented at 9:43 PM on January 2, 2019: member

    Have been the same since #7553

  9. in src/test/net_tests.cpp:245 in 6dc4593db1
     240 | +
     241 | +    BOOST_CHECK_EQUAL(IsReachable(NET_IPV4), false);
     242 | +    BOOST_CHECK_EQUAL(IsReachable(NET_IPV6), false);
     243 | +    BOOST_CHECK_EQUAL(IsReachable(NET_ONION), false);
     244 | +
     245 | +
    


    promag commented at 11:13 PM on January 4, 2019:

    nit, remove 2nd new line.

  10. practicalswift commented at 5:06 PM on January 5, 2019: contributor

    utACK 6dc4593db1ccfb8745b2daa42f457981ae08dba9

    Warm welcome as a contributor! I look forward to more test improvements from you :-)

  11. laanwj commented at 3:52 PM on January 9, 2019: member

    I'm not going to block merging this on an extra newline.

  12. laanwj merged this on Jan 9, 2019
  13. laanwj closed this on Jan 9, 2019

  14. laanwj referenced this in commit 854ca855ab on Jan 9, 2019
  15. laanwj referenced this in commit 43a79d22c1 on Jan 14, 2019
  16. PastaPastaPasta referenced this in commit 8cf5230dc1 on Jun 26, 2021
  17. PastaPastaPasta referenced this in commit 8223053a49 on Jun 28, 2021
  18. PastaPastaPasta referenced this in commit b8bc9e9643 on Jul 18, 2021
  19. PastaPastaPasta referenced this in commit 325aff4094 on Jul 18, 2021
  20. random-zebra referenced this in commit b4751e10ce on Aug 11, 2021
  21. DrahtBot locked this on Feb 15, 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-21 21:15 UTC

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