]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add a test for default/port conflicts in tor_addr_port_parse
authorNick Mathewson <nickm@torproject.org>
Sat, 5 Apr 2014 18:18:39 +0000 (14:18 -0400)
committerNick Mathewson <nickm@torproject.org>
Sat, 5 Apr 2014 18:18:39 +0000 (14:18 -0400)
src/test/test_addr.c

index 5452ee9070b0d328ec853aa858c9c897fcfb0ab0..6228fabad6c7eb957fc3cf44e336230370dcf5ac 100644 (file)
@@ -785,6 +785,14 @@ test_addr_parse(void)
                          &addr, &port, -1);
   test_assert(r == -1);
 
+  /* Make sure that the default port has lower priority than the real
+     one */
+  r= tor_addr_port_parse(LOG_DEBUG,
+                         "192.0.2.2:1337",
+                         &addr, &port, 200);
+  test_assert(r == 0);
+  tt_int_op(port,==,1337);
+
  done:
   ;
 }