wine/dlls/wininet/tests http.c

Alexandre Julliard julliard at wine.codeweavers.com
Wed Nov 30 06:01:50 CST 2005


ChangeSet ID:	21565
CVSROOT:	/opt/cvs-commit
Module name:	wine
Changes by:	julliard at winehq.org	2005/11/30 06:01:49

Modified files:
	dlls/wininet/tests: http.c 

Log message:
	Robert Shearman <rob at codeweavers.com>
	Test the behaviour of HttpSendRequestEx when putting data into the
	lpvBuffer.

Patch: http://cvs.winehq.org/patch.py?id=21565

Old revision  New revision  Changes     Path
 1.36          1.37          +6 -5       wine/dlls/wininet/tests/http.c

Index: wine/dlls/wininet/tests/http.c
diff -u -p wine/dlls/wininet/tests/http.c:1.36 wine/dlls/wininet/tests/http.c:1.37
--- wine/dlls/wininet/tests/http.c:1.36	30 Nov 2005 12: 1:49 -0000
+++ wine/dlls/wininet/tests/http.c	30 Nov 2005 12: 1:49 -0000
@@ -1066,6 +1066,7 @@ static void HttpSendRequestEx_test(void)
     DWORD dwBytesRead;
     CHAR szBuffer[256];
     int i;
+    BOOL ret;
 
     static const char szPostData[] = "mode=Test";
     static const char szContentType[] = "Content-Type: application/x-www-form-urlencoded";
@@ -1087,16 +1088,16 @@ static void HttpSendRequestEx_test(void)
     BufferIn.lpcszHeader = szContentType;
     BufferIn.dwHeadersLength = sizeof(szContentType);
     BufferIn.dwHeadersTotal = sizeof(szContentType);
-    BufferIn.lpvBuffer = NULL;
-    BufferIn.dwBufferLength = 0;
+    BufferIn.lpvBuffer = (LPVOID)szPostData;
+    BufferIn.dwBufferLength = 3;
     BufferIn.dwBufferTotal = sizeof(szPostData)-1;
     BufferIn.dwOffsetLow = 0;
     BufferIn.dwOffsetHigh = 0;
 
-    ok(HttpSendRequestEx(hRequest, &BufferIn, NULL, 0 ,0), 
-            "SendRequestEx Failed\n");
+    ret = HttpSendRequestEx(hRequest, &BufferIn, NULL, 0 ,0);
+    ok(ret, "HttpSendRequestEx Failed with error %ld\n", GetLastError());
 
-    for (i = 0; szPostData[i]; i++)
+    for (i = 3; szPostData[i]; i++)
         ok(InternetWriteFile(hRequest, &szPostData[i], 1, &dwBytesWritten),
                 "InternetWriteFile failed\n");
 



More information about the wine-cvs mailing list