]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
fixup! Add networkstatus_consensus_has_ipv6() and unit tests
authorteor <teor2345@gmail.com>
Sun, 10 Dec 2017 13:51:40 +0000 (00:51 +1100)
committerteor <teor2345@gmail.com>
Sun, 10 Dec 2017 13:53:03 +0000 (00:53 +1100)
This is what happens when you don't run:
make check-spaces
make check-changes

changes/bug23827
src/test/test_dir.c

index 6954ef891db768f00943cbfaa979ba2bad695729..7c626e1b38391f8ae2e058e92be95e8cfd8a3f9d 100644 (file)
@@ -1,7 +1,7 @@
   o Minor feature (IPv6):
     - When a consensus has IPv6 ORPorts, make IPv6-only clients use them,
       rather than waiting to download microdescriptors.
-      Implements #23827.
+      Implements 23827.
     - Make IPv6-only clients wait for microdescs for relays, even if we were
       previously using descriptors (or were using them as a bridge) and have
       a cached descriptor for them.
index 0da4e7e15a0bc150bf9d68a6a2deec9ee4609790..c85f7f0652570f3bda0835371f249d1b269b19e7 100644 (file)
@@ -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;