diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-05-31 09:03:16 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-05-31 09:03:20 -0400 |
commit | 3c3158f1826826d9b4e8841bc67855cca0fc883b (patch) | |
tree | a04f7e13c16855a801726ffe1aefa5da179ff58a /src/test/test_config.c | |
parent | 70b85358afd0a8d4291489f9e9f5654ab2d53371 (diff) | |
download | tor-3c3158f1826826d9b4e8841bc67855cca0fc883b.tar.gz tor-3c3158f1826826d9b4e8841bc67855cca0fc883b.zip |
Fix some tests for CL_PORT_NO_STREAM_OPTIONS
The comment in the tests was correct: this option _was_ inverted wrt
SessionGroup=.
Diffstat (limited to 'src/test/test_config.c')
-rw-r--r-- | src/test/test_config.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/test/test_config.c b/src/test/test_config.c index c342d8cca4..0de6b12919 100644 --- a/src/test/test_config.c +++ b/src/test/test_config.c @@ -4568,16 +4568,14 @@ test_config_parse_port_config__ports__ports_given(void *data) "127.0.0.44", 0, CL_PORT_NO_STREAM_OPTIONS); tt_int_op(ret, OP_EQ, -1); - // TODO: this seems wrong. Shouldn't it be the other way around? - // Potential bug. - // Test failure for a SessionGroup argument with valid value but with stream - // options allowed + // Test failure for a SessionGroup argument with valid value but with no + // stream options allowed config_free_lines(config_port_invalid); config_port_invalid = NULL; SMARTLIST_FOREACH(slout,port_cfg_t *,pf,port_cfg_free(pf)); smartlist_clear(slout); config_port_invalid = mock_config_line("DNSPort", "42 SessionGroup=123"); ret = parse_port_config(slout, config_port_invalid, "DNS", 0, - "127.0.0.44", 0, 0); + "127.0.0.44", 0, CL_PORT_NO_STREAM_OPTIONS); tt_int_op(ret, OP_EQ, -1); // Test failure for more than one SessionGroup argument @@ -4587,7 +4585,7 @@ test_config_parse_port_config__ports__ports_given(void *data) config_port_invalid = mock_config_line("DNSPort", "42 SessionGroup=123 " "SessionGroup=321"); ret = parse_port_config(slout, config_port_invalid, "DNS", 0, - "127.0.0.44", 0, CL_PORT_NO_STREAM_OPTIONS); + "127.0.0.44", 0, 0); tt_int_op(ret, OP_EQ, -1); // Test success with a sessiongroup options @@ -4596,7 +4594,7 @@ test_config_parse_port_config__ports__ports_given(void *data) smartlist_clear(slout); config_port_valid = mock_config_line("DNSPort", "42 SessionGroup=1111122"); ret = parse_port_config(slout, config_port_valid, "DNS", 0, - "127.0.0.44", 0, CL_PORT_NO_STREAM_OPTIONS); + "127.0.0.44", 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); |