diff options
author | Kaidan <fishstacks@protonmail.com> | 2018-07-08 00:15:16 +1000 |
---|---|---|
committer | Kaidan <fishstacks@protonmail.com> | 2018-07-08 00:15:16 +1000 |
commit | abeb07a1bff4f68a3143bb47a6123c0fef83ff79 (patch) | |
tree | 801ffaf0bfcbc12d5f6a8cdcbc45359ff07efe97 /src/test/test_config.c | |
parent | 10c782d7fa227bb426af5bcbe0073c366d93594a (diff) | |
download | tor-abeb07a1bff4f68a3143bb47a6123c0fef83ff79.tar.gz tor-abeb07a1bff4f68a3143bb47a6123c0fef83ff79.zip |
Made 'auto' keyword in torrc case insensitive
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 596ae04482..2bcdcc4e9c 100644 --- a/src/test/test_config.c +++ b/src/test/test_config.c @@ -4602,6 +4602,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)); |