=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: wininet/tests: Don' t test function directly when reporting GetLastError().

Alexandre Julliard julliard at winehq.org
Tue Sep 24 03:22:00 CDT 2013


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

Author: André Hentschel <nerv at dawncrow.de>
Date:   Sun Sep 22 21:35:34 2013 +0200

wininet/tests: Don't test function directly when reporting GetLastError().

---

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

diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c
index 2526681..12eab57 100644
--- a/dlls/wininet/tests/http.c
+++ b/dlls/wininet/tests/http.c
@@ -1468,6 +1468,7 @@ static void HttpHeaders_test(void)
     DWORD     len = 256;
     DWORD     oldlen;
     DWORD     index = 0;
+    BOOL      ret;
 
     hSession = InternetOpen("Wine Regression Test",
             INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0);
@@ -1759,19 +1760,19 @@ static void HttpHeaders_test(void)
     ok(index == 1, "Index was not incremented\n");
     ok(strcmp(buffer,"value3")==0, "incorrect string was returned(%s)\n",buffer);
 
-    ok(HttpAddRequestHeaders(hRequest, "Authorization: Basic\r\n", -1, HTTP_ADDREQ_FLAG_ADD),
-       "unable to add header %u\n", GetLastError());
+    ret = HttpAddRequestHeaders(hRequest, "Authorization: Basic\r\n", -1, HTTP_ADDREQ_FLAG_ADD);
+    ok(ret, "unable to add header %u\n", GetLastError());
 
     index = 0;
     buffer[0] = 0;
     len = sizeof(buffer);
-    ok(HttpQueryInfo(hRequest, HTTP_QUERY_AUTHORIZATION|HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &len, &index),
-       "unable to query header %u\n", GetLastError());
+    ret = HttpQueryInfo(hRequest, HTTP_QUERY_AUTHORIZATION|HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &len, &index);
+    ok(ret, "unable to query header %u\n", GetLastError());
     ok(index == 1, "index was not incremented\n");
     ok(!strcmp(buffer, "Basic"), "incorrect string was returned (%s)\n", buffer);
 
-    ok(HttpAddRequestHeaders(hRequest, "Authorization:\r\n", -1, HTTP_ADDREQ_FLAG_REPLACE),
-       "unable to remove header %u\n", GetLastError());
+    ret = HttpAddRequestHeaders(hRequest, "Authorization:\r\n", -1, HTTP_ADDREQ_FLAG_REPLACE);
+    ok(ret, "unable to remove header %u\n", GetLastError());
 
     index = 0;
     len = sizeof(buffer);




More information about the wine-cvs mailing list