diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2010-02-04 00:06:00 +0100 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2010-02-04 00:06:56 +0100 |
commit | 30b6fe6e9b7cae25bd87d436eb4f78300313c94f (patch) | |
tree | 1cdf6566096aa50179d3f8242c78f029d0a5bb98 /src/test | |
parent | 25ec240cc344adc1ca0a5e10179d7e47d8af9532 (diff) | |
download | tor-30b6fe6e9b7cae25bd87d436eb4f78300313c94f.tar.gz tor-30b6fe6e9b7cae25bd87d436eb4f78300313c94f.zip |
Another unit test for exit_policy_is_general_exit()
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/test/test.c b/src/test/test.c index e1f1d40cd4..d7575ac61f 100644 --- a/src/test/test.c +++ b/src/test/test.c @@ -648,7 +648,7 @@ test_policies(void) { int i; smartlist_t *policy = NULL, *policy2 = NULL, *policy3 = NULL, - *policy4 = NULL, *policy5 = NULL; + *policy4 = NULL, *policy5 = NULL, *policy6 = NULL; addr_policy_t *p; tor_addr_t tar; config_line_t line; @@ -695,7 +695,6 @@ test_policies(void) smartlist_add(policy4, p); policy5 = smartlist_create(); - p = router_parse_addr_policy_item_from_string("reject 0.0.0.0/8:*",-1); test_assert(p != NULL); smartlist_add(policy5, p); @@ -726,6 +725,11 @@ test_policies(void) p = router_parse_addr_policy_item_from_string("accept *:1-65535",-1); test_assert(p != NULL); smartlist_add(policy5, p); + + policy6 = smartlist_create(); + p = router_parse_addr_policy_item_from_string("accept 43.3.0.0/9:*",-1); + test_assert(p != NULL); + smartlist_add(policy6, p); test_assert(!exit_policy_is_general_exit(policy)); test_assert(exit_policy_is_general_exit(policy2)); @@ -733,6 +737,7 @@ test_policies(void) test_assert(!exit_policy_is_general_exit(policy3)); test_assert(!exit_policy_is_general_exit(policy4)); test_assert(!exit_policy_is_general_exit(policy5)); + test_assert(!exit_policy_is_general_exit(policy6)); test_assert(cmp_addr_policies(policy, policy2)); test_assert(cmp_addr_policies(policy, NULL)); @@ -847,6 +852,7 @@ test_policies(void) addr_policy_list_free(policy3); addr_policy_list_free(policy4); addr_policy_list_free(policy5); + addr_policy_list_free(policy6); tor_free(policy_str); if (sm) { SMARTLIST_FOREACH(sm, char *, s, tor_free(s)); |