Skip to content
Snippets Groups Projects
Commit 7a18ac74 authored by Yawning Angel's avatar Yawning Angel
Browse files

Fixed the test build with --enable-gcc-warnings

parent 41d2b4d3
No related branches found
No related tags found
No related merge requests found
......@@ -464,7 +464,7 @@ test_get_pt_proxy_uri(void *arg)
tt_assert(uri == NULL);
/* Test with a SOCKS4 proxy. */
options->Socks4Proxy = "192.0.2.1:1080";
options->Socks4Proxy = tor_strdup("192.0.2.1:1080");
ret = tor_addr_port_lookup(options->Socks4Proxy,
&options->Socks4ProxyAddr,
&options->Socks4ProxyPort);
......@@ -472,11 +472,10 @@ test_get_pt_proxy_uri(void *arg)
uri = get_pt_proxy_uri();
tt_str_op(uri, ==, "socks4a://192.0.2.1:1080");
tor_free(uri);
options->Socks4Proxy = NULL;
tor_free(options->Socks4Proxy);
/* Test with a SOCKS5 proxy, no username/password. */
options->Socks5Proxy = "192.0.2.1:1080";
options->Socks5Proxy = tor_strdup("192.0.2.1:1080");
ret = tor_addr_port_lookup(options->Socks5Proxy,
&options->Socks5ProxyAddr,
&options->Socks5ProxyPort);
......@@ -486,16 +485,17 @@ test_get_pt_proxy_uri(void *arg)
tor_free(uri);
/* Test with a SOCKS5 proxy, with username/password. */
options->Socks5ProxyUsername = "hwest";
options->Socks5ProxyPassword = "r34n1m470r";
options->Socks5ProxyUsername = tor_strdup("hwest");
options->Socks5ProxyPassword = tor_strdup("r34n1m470r");
uri = get_pt_proxy_uri();
tt_str_op(uri, ==, "socks5://hwest:r34n1m470r@192.0.2.1:1080");
tor_free(uri);
options->Socks5Proxy = NULL;
tor_free(options->Socks5Proxy);
tor_free(options->Socks5ProxyUsername);
tor_free(options->Socks5ProxyPassword);
/* Test with a HTTPS proxy, no authenticator. */
options->HTTPSProxy = "192.0.2.1:80";
options->HTTPSProxy = tor_strdup("192.0.2.1:80");
ret = tor_addr_port_lookup(options->HTTPSProxy,
&options->HTTPSProxyAddr,
&options->HTTPSProxyPort);
......@@ -505,15 +505,15 @@ test_get_pt_proxy_uri(void *arg)
tor_free(uri);
/* Test with a HTTPS proxy, with authenticator. */
options->HTTPSProxyAuthenticator = "hwest:r34n1m470r";
options->HTTPSProxyAuthenticator = tor_strdup("hwest:r34n1m470r");
uri = get_pt_proxy_uri();
tt_str_op(uri, ==, "http://hwest:r34n1m470r@192.0.2.1:80");
tor_free(uri);
options->HTTPSProxy = NULL;
tor_free(options->HTTPSProxy);
tor_free(options->HTTPSProxyAuthenticator);
/* Token nod to the fact that IPv6 exists. */
options->Socks4Proxy = "[2001:db8::1]:1080";
options->Socks4Proxy = tor_strdup("[2001:db8::1]:1080");
ret = tor_addr_port_lookup(options->Socks4Proxy,
&options->Socks4ProxyAddr,
&options->Socks4ProxyPort);
......@@ -521,7 +521,7 @@ test_get_pt_proxy_uri(void *arg)
uri = get_pt_proxy_uri();
tt_str_op(uri, ==, "socks4a://[2001:db8::1]:1080");
tor_free(uri);
tor_free(options->Socks4Proxy);
done:
if (uri)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment