diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-10-13 16:04:25 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-10-13 16:04:25 -0400 |
commit | 8c837db38f5b2015dd579de8d8df580f51d133bc (patch) | |
tree | 8a67afb20b2b998fa20b11c522acf1cb3cd634c6 /src/test | |
parent | cbda016bc5f588351900433835bca912efeb41c4 (diff) | |
parent | c9dece14ae7d9c14c17df6685f7504c23eb65899 (diff) | |
download | tor-8c837db38f5b2015dd579de8d8df580f51d133bc.tar.gz tor-8c837db38f5b2015dd579de8d8df580f51d133bc.zip |
Merge branch 'nodes'
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test.c | 5 | ||||
-rw-r--r-- | src/test/test_dir.c | 12 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/test/test.c b/src/test/test.c index 104c607785..3f014186a0 100644 --- a/src/test/test.c +++ b/src/test/test.c @@ -576,6 +576,7 @@ test_policy_summary_helper(const char *policy_str, smartlist_t *policy = smartlist_create(); char *summary = NULL; int r; + short_policy_t *short_policy = NULL; line.key = (char*)"foo"; line.value = (char *)policy_str; @@ -588,10 +589,14 @@ test_policy_summary_helper(const char *policy_str, test_assert(summary != NULL); test_streq(summary, expected_summary); + short_policy = parse_short_policy(summary); + tt_assert(short_policy); + done: tor_free(summary); if (policy) addr_policy_list_free(policy); + short_policy_free(short_policy); } /** Run unit tests for generating summary lines of exit policies */ diff --git a/src/test/test_dir.c b/src/test/test_dir.c index 80d2379de6..3c660a7575 100644 --- a/src/test/test_dir.c +++ b/src/test/test_dir.c @@ -801,7 +801,7 @@ test_dir_v3_networkstatus(void) rs->or_port = 443; rs->dir_port = 8000; /* all flags but running cleared */ - rs->is_running = 1; + rs->is_flagged_running = 1; smartlist_add(vote->routerstatus_list, vrs); test_assert(router_add_to_routerlist(generate_ri_from_rs(vrs), &msg,0,0)>=0); @@ -816,7 +816,7 @@ test_dir_v3_networkstatus(void) rs->addr = 0x99009901; rs->or_port = 443; rs->dir_port = 0; - rs->is_exit = rs->is_stable = rs->is_fast = rs->is_running = + rs->is_exit = rs->is_stable = rs->is_fast = rs->is_flagged_running = rs->is_valid = rs->is_v2_dir = rs->is_possible_guard = 1; smartlist_add(vote->routerstatus_list, vrs); test_assert(router_add_to_routerlist(generate_ri_from_rs(vrs), &msg,0,0)>=0); @@ -833,7 +833,8 @@ test_dir_v3_networkstatus(void) rs->or_port = 400; rs->dir_port = 9999; rs->is_authority = rs->is_exit = rs->is_stable = rs->is_fast = - rs->is_running = rs->is_valid = rs->is_v2_dir = rs->is_possible_guard = 1; + rs->is_flagged_running = rs->is_valid = rs->is_v2_dir = + rs->is_possible_guard = 1; smartlist_add(vote->routerstatus_list, vrs); test_assert(router_add_to_routerlist(generate_ri_from_rs(vrs), &msg,0,0)>=0); @@ -1073,7 +1074,8 @@ test_dir_v3_networkstatus(void) test_assert(!rs->is_fast); test_assert(!rs->is_possible_guard); test_assert(!rs->is_stable); - test_assert(rs->is_running); /* If it wasn't running it wouldn't be here */ + /* (If it wasn't running it wouldn't be here) */ + test_assert(rs->is_flagged_running); test_assert(!rs->is_v2_dir); test_assert(!rs->is_valid); test_assert(!rs->is_named); @@ -1095,7 +1097,7 @@ test_dir_v3_networkstatus(void) test_assert(rs->is_fast); test_assert(rs->is_possible_guard); test_assert(rs->is_stable); - test_assert(rs->is_running); + test_assert(rs->is_flagged_running); test_assert(rs->is_v2_dir); test_assert(rs->is_valid); test_assert(!rs->is_named); |