wininet: Fix tests when running behind a proxy server

Juan Lang juan.lang at gmail.com
Thu Jul 9 13:55:16 CDT 2009


A proxy server strips/replaces the proxy headers, so the tests that
expect to see them fail.

A mere skip might be too lax.  Perhaps I should be checking whether a
proxy is configured first?  Let me know and I'll adjust it.
--Juan
-------------- next part --------------
From 96533a549c1843942bca6676f90339473669eabb Mon Sep 17 00:00:00 2001
From: Juan Lang <juan.lang at gmail.com>
Date: Thu, 9 Jul 2009 10:19:00 -0700
Subject: [PATCH 04/14] Fix tests when running behind a proxy server

---
 dlls/wininet/tests/http.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c
index bf6ca02..b11cb2c 100644
--- a/dlls/wininet/tests/http.c
+++ b/dlls/wininet/tests/http.c
@@ -1788,7 +1788,12 @@ static void test_proxy_indirect(int port)
 
     sz = sizeof buffer;
     r = HttpQueryInfo(hr, HTTP_QUERY_PROXY_AUTHENTICATE, buffer, &sz, NULL);
-    ok(r, "HttpQueryInfo failed\n");
+    ok(r || GetLastError() == ERROR_HTTP_HEADER_NOT_FOUND, "HttpQueryInfo failed: %d\n", GetLastError());
+    if (!r)
+    {
+        skip("missing proxy header, not testing remaining proxy headers\n");
+        goto out;
+    }
     ok(!strcmp(buffer, "Basic realm=\"placebo\""), "proxy auth info wrong\n");
 
     sz = sizeof buffer;
@@ -1821,6 +1826,7 @@ static void test_proxy_indirect(int port)
     ok(GetLastError() == ERROR_HTTP_HEADER_NOT_FOUND, "HttpQueryInfo should fail\n");
     ok(r == FALSE, "HttpQueryInfo failed\n");
 
+out:
     InternetCloseHandle(hr);
     InternetCloseHandle(hc);
     InternetCloseHandle(hi);
-- 
1.6.3.2


More information about the wine-patches mailing list