From b5b8d9e1566d1fb7e1aa3553e6ac37c5b21939ba Mon Sep 17 00:00:00 2001 From: Sebastian Hahn Date: Wed, 3 Feb 2010 05:43:09 +0100 Subject: [PATCH] Another new test for exit_policy_is_general_exit() --- src/test/test.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/test/test.c b/src/test/test.c index 1aceffce03..7d836019da 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)); -- 2.47.3