summaryrefslogtreecommitdiff
path: root/src/or/test.c
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2008-08-13 12:46:13 +0000
committerPeter Palfrader <peter@palfrader.org>2008-08-13 12:46:13 +0000
commitadcea0f33257e1958e6caa2c42048b2caade3215 (patch)
tree5cc15c8f6cac7803d01bc8f58327ff2b07ccb279 /src/or/test.c
parent0d807068a30e71fa2dd4b2aac765f499f7944a7f (diff)
downloadtor-adcea0f33257e1958e6caa2c42048b2caade3215.tar.gz
tor-adcea0f33257e1958e6caa2c42048b2caade3215.zip
Think of the poor children in Antarctica who still have to work on 4" screens
svn:r16528
Diffstat (limited to 'src/or/test.c')
-rw-r--r--src/or/test.c49
1 files changed, 41 insertions, 8 deletions
diff --git a/src/or/test.c b/src/or/test.c
index 5372990c9d..6409e8c274 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -3327,7 +3327,8 @@ test_v3_networkstatus(void)
}
static void
-test_policy_summary_helper(const char *policy_str, const char *expected_summary)
+test_policy_summary_helper(const char *policy_str,
+ const char *expected_summary)
{
config_line_t line;
smartlist_t *policy;
@@ -3414,17 +3415,49 @@ test_policies(void)
/* test policy summaries */
/* check if we properly ignore private IP addresses */
- test_policy_summary_helper("reject 192.168.0.0/16:*,reject 0.0.0.0/8:*,reject 10.0.0.0/8:*,accept *:10-30,accept *:90,reject *:*", "accept 10-30,90");
+ test_policy_summary_helper("reject 192.168.0.0/16:*,"
+ "reject 0.0.0.0/8:*,"
+ "reject 10.0.0.0/8:*,"
+ "accept *:10-30,"
+ "accept *:90,"
+ "reject *:*",
+ "accept 10-30,90");
/* check all accept policies, and proper counting of rejects */
- test_policy_summary_helper("reject 11.0.0.0/9:80, reject 12.0.0.0/9:80, reject 13.0.0.0/9:80, reject 14.0.0.0/9:80, accept *:*", "accept 1-65535");
- test_policy_summary_helper("reject 11.0.0.0/9:80, reject 12.0.0.0/9:80, reject 13.0.0.0/9:80, reject 14.0.0.0/9:80, reject 15.0.0.0:81, accept *:*", "accept 1-65535");
- test_policy_summary_helper("reject 11.0.0.0/9:80, reject 12.0.0.0/9:80, reject 13.0.0.0/9:80, reject 14.0.0.0/9:80, reject 15.0.0.0:80, accept *:*", "reject 80");
+ test_policy_summary_helper("reject 11.0.0.0/9:80,"
+ "reject 12.0.0.0/9:80,"
+ "reject 13.0.0.0/9:80,"
+ "reject 14.0.0.0/9:80,"
+ "accept *:*", "accept 1-65535");
+ test_policy_summary_helper("reject 11.0.0.0/9:80,"
+ "reject 12.0.0.0/9:80,"
+ "reject 13.0.0.0/9:80,"
+ "reject 14.0.0.0/9:80,"
+ "reject 15.0.0.0:81,"
+ "accept *:*", "accept 1-65535");
+ test_policy_summary_helper("reject 11.0.0.0/9:80,"
+ "reject 12.0.0.0/9:80,"
+ "reject 13.0.0.0/9:80,"
+ "reject 14.0.0.0/9:80,"
+ "reject 15.0.0.0:80,"
+ "accept *:*",
+ "reject 80");
/* no exits */
- test_policy_summary_helper("accept 11.0.0.0/9:80, reject *:*", NULL);
+ test_policy_summary_helper("accept 11.0.0.0/9:80,"
+ "reject *:*",
+ NULL);
/* port merging */
- test_policy_summary_helper("accept *:80, accept *:81, accept *:100-110, accept *:111, reject *:*", "accept 80-81,100-111");
+ test_policy_summary_helper("accept *:80,"
+ "accept *:81,"
+ "accept *:100-110,"
+ "accept *:111,"
+ "reject *:*",
+ "accept 80-81,100-111");
/* border ports */
- test_policy_summary_helper("accept *:1, accept *:3, accept *:65535, reject *:*", "accept 1,3,65535");
+ test_policy_summary_helper("accept *:1,"
+ "accept *:3,"
+ "accept *:65535,"
+ "reject *:*",
+ "accept 1,3,65535");
}
static void