Paul TBBle Hampson : wininet/tests: Test for handling of blank headers in HttpAddRequestHeaders.

Alexandre Julliard julliard at winehq.org
Mon Apr 27 08:04:07 CDT 2009


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

Author: Paul TBBle Hampson <Paul.Hampson at Pobox.com>
Date:   Sat Apr 25 02:25:01 2009 +1000

wininet/tests: Test for handling of blank headers in HttpAddRequestHeaders.

---

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

diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c
index bb701b0..79b5683 100644
--- a/dlls/wininet/tests/http.c
+++ b/dlls/wininet/tests/http.c
@@ -1274,6 +1274,17 @@ static void HttpHeaders_test(void)
     strcpy(buffer,"Warning");
     ok(HttpQueryInfo(hRequest,HTTP_QUERY_CUSTOM|HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer,&len,&index)==0,"Third Header Should Not Exist\n");
 
+    /* Ensure that blank headers are ignored and don't cause a failure */
+    todo_wine{
+    ok(HttpAddRequestHeaders(hRequest,"\r\nBlankTest:value\r\n\r\n",-1, HTTP_ADDREQ_FLAG_ADD_IF_NEW), "Failed to add header with blank entries in list\n");
+
+    index = 0;
+    len = sizeof(buffer);
+    strcpy(buffer,"BlankTest");
+    ok(HttpQueryInfo(hRequest,HTTP_QUERY_CUSTOM|HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer,&len,&index),"Unable to query header\n");
+    ok(index == 1, "Index was not incremented\n");
+    ok(strcmp(buffer,"value")==0, "incorrect string was returned(%s)\n",buffer);
+    }
 
     ok(InternetCloseHandle(hRequest), "Close request handle failed\n");
 done:




More information about the wine-cvs mailing list