diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-07-12 08:59:23 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-07-12 08:59:23 -0400 |
commit | a7ec493d88bfdd2735ee50893dfa890e60900e2b (patch) | |
tree | 13ef463f8285f11f2d63e2a0b2a2dcaf96e56545 /src/test/test_config.c | |
parent | 66074ad1e21cfe6c98a70b279ed690e357d1c41c (diff) | |
parent | abeb07a1bff4f68a3143bb47a6123c0fef83ff79 (diff) | |
download | tor-a7ec493d88bfdd2735ee50893dfa890e60900e2b.tar.gz tor-a7ec493d88bfdd2735ee50893dfa890e60900e2b.zip |
Merge remote-tracking branch 'imnotbad/bug26663'
Diffstat (limited to 'src/test/test_config.c')
-rw-r--r-- | src/test/test_config.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/test_config.c b/src/test/test_config.c index 393378b4c8..f5c759402c 100644 --- a/src/test/test_config.c +++ b/src/test/test_config.c @@ -4637,6 +4637,20 @@ test_config_parse_port_config__ports__ports_given(void *data) tor_addr_parse(&addr, "127.0.0.46"); tt_assert(tor_addr_eq(&port_cfg->addr, &addr)) + // Test success with a port of auto in mixed case + config_free_lines(config_port_valid); config_port_valid = NULL; + SMARTLIST_FOREACH(slout,port_cfg_t *,pf,port_cfg_free(pf)); + smartlist_clear(slout); + config_port_valid = mock_config_line("DNSPort", "AuTo"); + ret = parse_port_config(slout, config_port_valid, "DNS", 0, + "127.0.0.46", 0, 0); + tt_int_op(ret, OP_EQ, 0); + tt_int_op(smartlist_len(slout), OP_EQ, 1); + port_cfg = (port_cfg_t *)smartlist_get(slout, 0); + tt_int_op(port_cfg->port, OP_EQ, CFG_AUTO_PORT); + tor_addr_parse(&addr, "127.0.0.46"); + tt_assert(tor_addr_eq(&port_cfg->addr, &addr)) + // Test success with parsing both an address and an auto port config_free_lines(config_port_valid); config_port_valid = NULL; SMARTLIST_FOREACH(slout,port_cfg_t *,pf,port_cfg_free(pf)); |