Hans Leidekker : winhttp/tests: Make sure proxy settings are restored.

Alexandre Julliard julliard at winehq.org
Fri Dec 21 11:05:21 CST 2012


Module: wine
Branch: master
Commit: ec1ae3b6e64642e03fde382bd83e07aa1856c2ae
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ec1ae3b6e64642e03fde382bd83e07aa1856c2ae

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Fri Dec 21 13:55:41 2012 +0100

winhttp/tests: Make sure proxy settings are restored.

---

 dlls/winhttp/tests/winhttp.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c
index 5fcdef6..05e7804 100644
--- a/dlls/winhttp/tests/winhttp.c
+++ b/dlls/winhttp/tests/winhttp.c
@@ -1070,23 +1070,23 @@ static void test_set_default_proxy_config(void)
     info.lpszProxy = wideString;
     SetLastError(0xdeadbeef);
     ret = WinHttpSetDefaultProxyConfiguration(&info);
-    ok((!ret && GetLastError() == ERROR_INVALID_PARAMETER) ||
-        broken(ret), /* Earlier winhttp versions on W2K/XP */
-        "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+    if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
+        skip("couldn't set default proxy configuration: access denied\n");
+    else
+        ok((!ret && GetLastError() == ERROR_INVALID_PARAMETER) ||
+           broken(ret), /* Earlier winhttp versions on W2K/XP */
+           "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
 
     info.lpszProxy = normalString;
     SetLastError(0xdeadbeef);
     ret = WinHttpSetDefaultProxyConfiguration(&info);
-    if (ret)
-    {
-        ok(ret, "always true\n");
-        set_default_proxy_reg_value( saved_proxy_settings, len, type );
-    }
-    else if (GetLastError() == ERROR_ACCESS_DENIED)
+    if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
         skip("couldn't set default proxy configuration: access denied\n");
     else
         ok(ret, "WinHttpSetDefaultProxyConfiguration failed: %d\n",
            GetLastError());
+
+    set_default_proxy_reg_value( saved_proxy_settings, len, type );
 }
 
 static void test_Timeouts (void)




More information about the wine-cvs mailing list