[tor-commits] [tor/master] Add a test for default/port conflicts in tor_addr_port_parse
nickm at torproject.org
nickm at torproject.org
Sat Apr 5 18:51:13 UTC 2014
commit eefa3ebc786fdfd3a642698822f8a0ade583996e
Author: Nick Mathewson <nickm at torproject.org>
Date: Sat Apr 5 14:18:39 2014 -0400
Add a test for default/port conflicts in tor_addr_port_parse
---
src/test/test_addr.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/test/test_addr.c b/src/test/test_addr.c
index 5452ee9..6228fab 100644
--- a/src/test/test_addr.c
+++ b/src/test/test_addr.c
@@ -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:
;
}
More information about the tor-commits
mailing list