diff options
author | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2016-01-22 15:10:18 +1100 |
---|---|---|
committer | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2016-01-29 07:16:32 +1100 |
commit | 77a9de0d48e61e6762e65f6099c9a424544eb0ad (patch) | |
tree | bd79d43ad9ccb3942cd4c2d1c1699c94e86b7ef2 /src/test/test_entrynodes.c | |
parent | 3a00215c35b01909a2db24132ab800298d61b647 (diff) | |
download | tor-77a9de0d48e61e6762e65f6099c9a424544eb0ad.tar.gz tor-77a9de0d48e61e6762e65f6099c9a424544eb0ad.zip |
Automatically use IPv6 when ClientUseIPv4 is 0
Consequential changes to log messages:
* it's no longer possible to disable both IPv4 and IPv6,
* refactor common string out of remaining log messages
Diffstat (limited to 'src/test/test_entrynodes.c')
-rw-r--r-- | src/test/test_entrynodes.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c index a0208b9cfc..14baa8c9bf 100644 --- a/src/test/test_entrynodes.c +++ b/src/test/test_entrynodes.c @@ -215,20 +215,23 @@ test_choose_random_entry_one_possible_guard(void *arg) * time, so we can't be sure we get the guard */ tt_assert(chosen_entry); - /* Check that we get the guard if it passes preferred address settings when - * they're auto */ + /* Check that we get a node if it is allowed but not preferred when settings + * are auto */ memset(&mocked_options, 0, sizeof(mocked_options)); mocked_options.ClientUseIPv4 = 1; mocked_options.ClientPreferIPv6ORPort = -1; chosen_entry = choose_random_entry(NULL); - tt_ptr_op(chosen_entry, OP_EQ, the_guard); + + /* We disable the guard check and the preferred address check at the same + * time, so we can't be sure we get the guard */ + tt_assert(chosen_entry); /* and with IPv6 active */ mocked_options.ClientUseIPv6 = 1; chosen_entry = choose_random_entry(NULL); - tt_ptr_op(chosen_entry, OP_EQ, the_guard); + tt_assert(chosen_entry); done: memset(&mocked_options, 0, sizeof(mocked_options)); |