diff options
author | George Kadianakis <desnacked@riseup.net> | 2013-06-12 16:23:16 +0300 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-07-18 08:45:02 -0400 |
commit | ea72958f25f6326d6947c8cd4ef185912582d436 (patch) | |
tree | 8e5913b7f68caca5e184b1a8e737eb1bea2212de /src/test/test_util.c | |
parent | 6cfc2b5d73f6ec1b2ab4af1f209b6126a7d8cba9 (diff) | |
download | tor-ea72958f25f6326d6947c8cd4ef185912582d436.tar.gz tor-ea72958f25f6326d6947c8cd4ef185912582d436.zip |
Pass characters to be escaped to tor_escape_str_for_socks_arg().
This is in preparation for using tor_escape_str_for_socks_arg() to
escape server-side pluggable transport parameters.
Diffstat (limited to 'src/test/test_util.c')
-rw-r--r-- | src/test/test_util.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c index 2cc25e9861..54a089b368 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -803,30 +803,30 @@ test_util_escape_string_socks(void) char *escaped_string = NULL; /** Simple backslash escape. */ - escaped_string = tor_escape_str_for_socks_arg("This is a backslash: \\"); + escaped_string = tor_escape_str_for_socks_arg("This is a backslash: \\", ";\\"); test_assert(escaped_string); test_streq(escaped_string, "This is a backslash: \\\\"); tor_free(escaped_string); /** Simple semicolon escape. */ - escaped_string = tor_escape_str_for_socks_arg("First rule: Do not use ;"); + escaped_string = tor_escape_str_for_socks_arg("First rule: Do not use ;", ";\\"); test_assert(escaped_string); test_streq(escaped_string, "First rule: Do not use \\;"); tor_free(escaped_string); /** Empty string. */ - escaped_string = tor_escape_str_for_socks_arg(""); + escaped_string = tor_escape_str_for_socks_arg("", ";\\"); test_assert(escaped_string); test_streq(escaped_string, ""); tor_free(escaped_string); /** Escape all characters. */ - escaped_string = tor_escape_str_for_socks_arg(";\\;\\"); + escaped_string = tor_escape_str_for_socks_arg(";\\;\\", ";\\"); test_assert(escaped_string); test_streq(escaped_string, "\\;\\\\\\;\\\\"); tor_free(escaped_string); - escaped_string = tor_escape_str_for_socks_arg(";"); + escaped_string = tor_escape_str_for_socks_arg(";", ";\\"); test_assert(escaped_string); test_streq(escaped_string, "\\;"); tor_free(escaped_string); |