aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_policy.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-02-13 13:53:30 -0500
committerNick Mathewson <nickm@torproject.org>2017-02-14 16:31:11 -0500
commit1afc2ed956a35b40dfd1d207652af5b50c295da7 (patch)
treec8be4f7d2c49994945227fdaff0e5191ed857e4e /src/test/test_policy.c
parent4a2afd5b33f02ed3e5eb591dd29537fa4f69399f (diff)
downloadtor-1afc2ed956a35b40dfd1d207652af5b50c295da7.tar.gz
tor-1afc2ed956a35b40dfd1d207652af5b50c295da7.zip
Fix policies.c instance of the "if (r=(a-b)) return r" pattern
I think this one probably can't underflow, since the input ranges are small. But let's not tempt fate. This patch also replaces the "cmp" functions here with just "eq" functions, since nothing actually checked for anything besides 0 and nonzero. Related to 21278.
Diffstat (limited to 'src/test/test_policy.c')
-rw-r--r--src/test/test_policy.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/test_policy.c b/src/test/test_policy.c
index f2d42b9561..1ffdc2cd51 100644
--- a/src/test/test_policy.c
+++ b/src/test/test_policy.c
@@ -304,10 +304,10 @@ test_policies_general(void *arg)
tt_assert(!exit_policy_is_general_exit(policy10));
tt_assert(!exit_policy_is_general_exit(policy11));
- tt_assert(cmp_addr_policies(policy, policy2));
- tt_assert(cmp_addr_policies(policy, NULL));
- tt_assert(!cmp_addr_policies(policy2, policy2));
- tt_assert(!cmp_addr_policies(NULL, NULL));
+ tt_assert(!addr_policies_eq(policy, policy2));
+ tt_assert(!addr_policies_eq(policy, NULL));
+ tt_assert(addr_policies_eq(policy2, policy2));
+ tt_assert(addr_policies_eq(NULL, NULL));
tt_assert(!policy_is_reject_star(policy2, AF_INET, 1));
tt_assert(policy_is_reject_star(policy, AF_INET, 1));