aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2017-12-11 00:51:40 +1100
committerteor <teor2345@gmail.com>2017-12-11 00:53:03 +1100
commitbbc781885dd64142c687c21339d809782444e0c7 (patch)
tree48e2d1a2c461776d3f810f45eb383629a89952c0 /src
parentb66b62fb7525cac1e18385e130249ce24f5c9fea (diff)
downloadtor-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')
-rw-r--r--src/test/test_dir.c15
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;