diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-09-22 14:34:52 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-09-22 14:34:52 -0400 |
commit | bdd0c77643dfc5b3c5084a0f4dc53de393362796 (patch) | |
tree | 625d9dc2a98845e6c3d79d6806cea9b86beb9c30 /src/test/test_policy.c | |
parent | c8d927bad4cd690cad115d0610063003e76e0dd3 (diff) | |
parent | 80622c0664741e7947ace3972d106d94340aaf7c (diff) | |
download | tor-bdd0c77643dfc5b3c5084a0f4dc53de393362796.tar.gz tor-bdd0c77643dfc5b3c5084a0f4dc53de393362796.zip |
Merge branch 'bug8197_squashed'
Conflicts:
src/test/test_policy.c
Diffstat (limited to 'src/test/test_policy.c')
-rw-r--r-- | src/test/test_policy.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/test/test_policy.c b/src/test/test_policy.c index 61a5449c15..388251a61f 100644 --- a/src/test/test_policy.c +++ b/src/test/test_policy.c @@ -47,8 +47,11 @@ test_policy_summary_helper(const char *policy_str, line.value = (char *)policy_str; line.next = NULL; - r = policies_parse_exit_policy(&line, &policy, 1, 0, 0, 1); + r = policies_parse_exit_policy(&line, &policy, + EXIT_POLICY_IPV6_ENABLED | + EXIT_POLICY_ADD_DEFAULT ,0); tt_int_op(r,==, 0); + summary = policy_summarize(policy, AF_INET); tt_assert(summary != NULL); @@ -106,7 +109,11 @@ test_policies_general(void *arg) tt_assert(ADDR_POLICY_REJECTED == compare_tor_addr_to_addr_policy(&tar, 2, policy)); - tt_assert(0 == policies_parse_exit_policy(NULL, &policy2, 1, 1, 0, 1)); + tt_int_op(0, ==, policies_parse_exit_policy(NULL, &policy2, + EXIT_POLICY_IPV6_ENABLED | + EXIT_POLICY_REJECT_PRIVATE | + EXIT_POLICY_ADD_DEFAULT, 0)); + tt_assert(policy2); policy3 = smartlist_new(); @@ -193,8 +200,11 @@ test_policies_general(void *arg) line.key = (char*)"foo"; line.value = (char*)"accept *:80,reject private:*,reject *:*"; line.next = NULL; - tt_assert(0 == policies_parse_exit_policy(&line, &policy, 1, 0, 0, 1)); + tt_int_op(0, ==, policies_parse_exit_policy(&line,&policy, + EXIT_POLICY_IPV6_ENABLED | + EXIT_POLICY_ADD_DEFAULT,0)); tt_assert(policy); + //test_streq(policy->string, "accept *:80"); //test_streq(policy->next->string, "reject *:*"); tt_int_op(smartlist_len(policy),==, 4); |