Hans Leidekker : winhttp/tests: Fix a test that fails on Windows.

Alexandre Julliard julliard at winehq.org
Tue Jan 28 13:33:25 CST 2014


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue Jan 28 13:25:23 2014 +0100

winhttp/tests: Fix a test that fails on Windows.

---

 dlls/winhttp/tests/winhttp.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c
index 255eb09..74ec60d 100644
--- a/dlls/winhttp/tests/winhttp.c
+++ b/dlls/winhttp/tests/winhttp.c
@@ -292,7 +292,7 @@ static void test_SendRequest (void)
     static const WCHAR test_file[] = {'/','p','o','s','t','t','e','s','t','.','p','h','p',0};
     static const WCHAR test_verb[] = {'P','O','S','T',0};
     static CHAR post_data[] = "mode=Test";
-    static const char test_post[] = "mode => Test\\0\n";
+    static const char test_post[] = "mode => Test\0\n";
 
     header_len = -1L;
     total_len = optional_len = sizeof(post_data);
@@ -349,8 +349,8 @@ static void test_SendRequest (void)
     ret = WinHttpReadData(request, buffer, sizeof(buffer) - 1, &bytes_rw);
     ok(ret == TRUE, "WinHttpReadData failed: %u.\n", GetLastError());
 
-    ok(bytes_rw == strlen(test_post), "Read %u bytes instead of %d.\n", bytes_rw, lstrlenA(test_post));
-    ok(strncmp(buffer, test_post, bytes_rw) == 0, "Data read did not match, got '%s'.\n", buffer);
+    ok(bytes_rw == sizeof(test_post) - 1, "Read %u bytes\n", bytes_rw);
+    ok(!memcmp(buffer, test_post, sizeof(test_post) - 1), "Data read did not match.\n");
 
     ret = WinHttpCloseHandle(request);
     ok(ret == TRUE, "WinHttpCloseHandle failed on closing request, got %d.\n", ret);




More information about the wine-cvs mailing list