diff options
author | George Kadianakis <desnacked@riseup.net> | 2013-06-12 16:36:13 +0300 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-07-18 08:45:03 -0400 |
commit | 1a0cf08841904940ed46b2fcfd79cf65c65a1a6c (patch) | |
tree | 67cc87d4e1d641829243ee81908cef0a5bec4353 /src/test/test_util.c | |
parent | ea72958f25f6326d6947c8cd4ef185912582d436 (diff) | |
download | tor-1a0cf08841904940ed46b2fcfd79cf65c65a1a6c.tar.gz tor-1a0cf08841904940ed46b2fcfd79cf65c65a1a6c.zip |
Rename tor_escape_str_for_socks_arg() to something more generic.
Since we are going to be using that function to also escape parameters
passed to transport proxies using environment variables.
Diffstat (limited to 'src/test/test_util.c')
-rw-r--r-- | src/test/test_util.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c index 54a089b368..f7513c0f31 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -796,37 +796,37 @@ test_util_expand_filename(void) } #endif -/** Test tor_escape_str_for_socks_arg(). */ +/** Test tor_escape_str_for_pt_args(). */ static void 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_pt_args("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_pt_args("First rule:Do not use ;",";\\"); test_assert(escaped_string); - test_streq(escaped_string, "First rule: Do not use \\;"); + 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_pt_args("", ";\\"); 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_pt_args(";\\;\\", ";\\"); 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_pt_args(";", ";\\"); test_assert(escaped_string); test_streq(escaped_string, "\\;"); tor_free(escaped_string); |