]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
test: Fix duplicate ORPort test
authorDavid Goulet <dgoulet@torproject.org>
Thu, 11 Feb 2021 21:32:17 +0000 (16:32 -0500)
committerDavid Goulet <dgoulet@torproject.org>
Fri, 12 Feb 2021 18:13:43 +0000 (13:13 -0500)
The comment of that specific unit test wanted 4 ORPorts but for some reasons
we tested for 3 which before the previous commit related to #40289, test would
pass but it was in fact wrong.

Now the code is correct and 4 was in fact correct expected number of ports.

Related to #40289

Signed-off-by: David Goulet <dgoulet@torproject.org>
src/test/test_config.c

index 4eb4ac9cf566310dd37fdd8f1eb7b1672de85b70..cd7a54b97abfd0bdd5e1dfc5ea085f07b598c013 100644 (file)
@@ -6907,12 +6907,14 @@ test_config_duplicate_orports(void *arg)
 
   /* We have four address here, 1 IPv4 on 9050, IPv6 on 9050, IPv6 on 9051 and
    * a different IPv6 on 9051. */
-  tt_int_op(smartlist_len(ports), OP_EQ, 3);
+  tt_int_op(smartlist_len(ports), OP_EQ, 4);
   tt_str_op(describe_relay_port(smartlist_get(ports, 0)), OP_EQ,
             "ORPort 9050");
   tt_str_op(describe_relay_port(smartlist_get(ports, 1)), OP_EQ,
             "ORPort [4242::1]:9051");
   tt_str_op(describe_relay_port(smartlist_get(ports, 2)), OP_EQ,
+            "ORPort [4242::2]:9051");
+  tt_str_op(describe_relay_port(smartlist_get(ports, 3)), OP_EQ,
             "ORPort 9050");
 
   /* Reset. Test different ORPort value. */