aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2010-02-03 05:43:09 +0100
committerSebastian Hahn <sebastian@torproject.org>2010-02-03 05:45:29 +0100
commitb5b8d9e1566d1fb7e1aa3553e6ac37c5b21939ba (patch)
treeded7e32309b8a0ac46864c0bc8b1a227459c8abb /src
parentc54e33e4422d9979c7f6d94f6b6aea3bc33380eb (diff)
downloadtor-b5b8d9e1566d1fb7e1aa3553e6ac37c5b21939ba.tar
tor-b5b8d9e1566d1fb7e1aa3553e6ac37c5b21939ba.tar.gz
Another new test for exit_policy_is_general_exit()
Diffstat (limited to 'src')
-rw-r--r--src/test/test.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/test/test.c b/src/test/test.c
index 1aceffce0..7d836019d 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -647,7 +647,8 @@ static void
test_policies(void)
{
int i;
- smartlist_t *policy = NULL, *policy2 = NULL, *policy3 = NULL;
+ smartlist_t *policy = NULL, *policy2 = NULL, *policy3 = NULL,
+ *policy4 = NULL;
addr_policy_t *p;
tor_addr_t tar;
config_line_t line;
@@ -686,10 +687,19 @@ test_policies(void)
test_assert(p != NULL);
smartlist_add(policy3, p);
+ policy4 = smartlist_create();
+ p = router_parse_addr_policy_item_from_string("accept *:443",-1);
+ test_assert(p != NULL);
+ smartlist_add(policy4, p);
+ p = router_parse_addr_policy_item_from_string("accept *:443",-1);
+ test_assert(p != NULL);
+ smartlist_add(policy4, p);
+
test_assert(!exit_policy_is_general_exit(policy));
test_assert(exit_policy_is_general_exit(policy2));
test_assert(!exit_policy_is_general_exit(NULL));
test_assert(!exit_policy_is_general_exit(policy3));
+ test_assert(!exit_policy_is_general_exit(policy4));
test_assert(cmp_addr_policies(policy, policy2));
test_assert(cmp_addr_policies(policy, NULL));
@@ -802,6 +812,7 @@ test_policies(void)
addr_policy_list_free(policy);
addr_policy_list_free(policy2);
addr_policy_list_free(policy3);
+ addr_policy_list_free(policy4);
tor_free(policy_str);
if (sm) {
SMARTLIST_FOREACH(sm, char *, s, tor_free(s));