diff options
author | teor <teor2345@gmail.com> | 2017-12-11 00:51:40 +1100 |
---|---|---|
committer | teor <teor2345@gmail.com> | 2017-12-11 00:53:03 +1100 |
commit | bbc781885dd64142c687c21339d809782444e0c7 (patch) | |
tree | 48e2d1a2c461776d3f810f45eb383629a89952c0 /src/test | |
parent | b66b62fb7525cac1e18385e130249ce24f5c9fea (diff) | |
download | tor-bbc781885dd64142c687c21339d809782444e0c7.tar.gz tor-bbc781885dd64142c687c21339d809782444e0c7.zip |
fixup! Add networkstatus_consensus_has_ipv6() and unit tests
This is what happens when you don't run:
make check-spaces
make check-changes
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_dir.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/test/test_dir.c b/src/test/test_dir.c index 0da4e7e15a..c85f7f0652 100644 --- a/src/test/test_dir.c +++ b/src/test/test_dir.c @@ -6228,25 +6228,30 @@ test_dir_networkstatus_consensus_has_ipv6(void *arg) /* Test the bounds for A lines in the microdesc consensus */ mock_options->UseMicrodescriptors = 1; - mock_networkstatus->consensus_method = MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS; + mock_networkstatus->consensus_method = + MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS; has_ipv6 = networkstatus_consensus_has_ipv6(get_options()); tt_assert(has_ipv6); - mock_networkstatus->consensus_method = MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS + 1; + mock_networkstatus->consensus_method = + MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS + 1; has_ipv6 = networkstatus_consensus_has_ipv6(get_options()); tt_assert(has_ipv6); - mock_networkstatus->consensus_method = MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS + 20; + mock_networkstatus->consensus_method = + MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS + 20; has_ipv6 = networkstatus_consensus_has_ipv6(get_options()); tt_assert(has_ipv6); - mock_networkstatus->consensus_method = MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS - 1; + mock_networkstatus->consensus_method = + MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS - 1; has_ipv6 = networkstatus_consensus_has_ipv6(get_options()); tt_assert(!has_ipv6); /* Test the edge cases */ mock_options->UseMicrodescriptors = 1; - mock_networkstatus->consensus_method = MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS; + mock_networkstatus->consensus_method = + MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS; /* Reasonably live */ mock_networkstatus->valid_until = time(NULL) - 60; |