[2/2] wininet/tests: Add test for using NULL as proxy server. (v2)
Sebastian Lackner
sebastian at fds-team.de
Thu Oct 8 18:30:11 CDT 2015
Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
---
dlls/wininet/tests/internet.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c
index 2efde07..5636d4b 100644
--- a/dlls/wininet/tests/internet.c
+++ b/dlls/wininet/tests/internet.c
@@ -1349,6 +1349,35 @@ static void test_Option_PerConnectionOptionA(void)
HeapFree(GetProcessHeap(), 0, list.pOptions[0].Value.pszValue);
HeapFree(GetProcessHeap(), 0, list.pOptions);
+ /* test with NULL as proxy server */
+ list.dwOptionCount = 1;
+ list.pOptions = HeapAlloc(GetProcessHeap(), 0, sizeof(INTERNET_PER_CONN_OPTIONA));
+ list.pOptions[0].dwOption = INTERNET_PER_CONN_PROXY_SERVER;
+ list.pOptions[0].Value.pszValue = NULL;
+
+ ret = InternetSetOptionA(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION, &list, size);
+ ok(ret == TRUE, "InternetSetOption should've succeeded\n");
+
+ ret = InternetSetOptionA(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION, &list, size);
+ ok(ret == TRUE, "InternetSetOption should've succeeded\n");
+
+ HeapFree(GetProcessHeap(), 0, list.pOptions);
+
+ /* get & verify the proxy server */
+ list.dwOptionCount = 1;
+ list.dwOptionError = 0;
+ list.pOptions = HeapAlloc(GetProcessHeap(), 0, sizeof(INTERNET_PER_CONN_OPTIONA));
+ list.pOptions[0].dwOption = INTERNET_PER_CONN_PROXY_SERVER;
+
+ ret = InternetQueryOptionA(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION, &list, &size);
+ ok(ret == TRUE, "InternetQueryOption should've succeeded\n");
+ ok(!list.pOptions[0].Value.pszValue,
+ "Retrieved proxy server should've been NULL, was: \"%s\"\n",
+ list.pOptions[0].Value.pszValue);
+
+ HeapFree(GetProcessHeap(), 0, list.pOptions[0].Value.pszValue);
+ HeapFree(GetProcessHeap(), 0, list.pOptions);
+
/* restore original settings */
list.dwOptionCount = 2;
list.pOptions = orig_settings;
--
2.6.0
More information about the wine-patches
mailing list