[or-cvs] [tor/master 3/4] Another new test for exit_policy_is_general_exit()

nickm at torproject.org nickm at torproject.org
Wed Feb 3 05:13:25 UTC 2010


Author: Sebastian Hahn <sebastian at torproject.org>
Date: Wed, 3 Feb 2010 05:43:09 +0100
Subject: Another new test for exit_policy_is_general_exit()
Commit: b5b8d9e1566d1fb7e1aa3553e6ac37c5b21939ba

---
 src/test/test.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/test/test.c b/src/test/test.c
index 1aceffc..7d83601 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));
-- 
1.6.5




More information about the tor-commits mailing list