From 8fdd4d9b2a79463e70c6f4cb6805c6b6cd024993 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 17 May 2008 22:29:12 +0000 Subject: [PATCH] Forgot to commit urlmon.dll tests synced with Wine HEAD svn path=/trunk/; revision=33564 --- rostests/winetests/urlmon/protocol.c | 27 ++++++++++++++++++------- rostests/winetests/urlmon/urlmon.rbuild | 2 +- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/rostests/winetests/urlmon/protocol.c b/rostests/winetests/urlmon/protocol.c index c21134b0280..6361403f037 100644 --- a/rostests/winetests/urlmon/protocol.c +++ b/rostests/winetests/urlmon/protocol.c @@ -27,6 +27,7 @@ #include "winbase.h" #include "ole2.h" #include "urlmon.h" +#include "wininet.h" #include "initguid.h" @@ -1383,11 +1384,21 @@ static void test_file_protocol_fail(void) CHECK_CALLED(ReportProgress_SENDINGREQUEST); CHECK_CALLED(ReportResult); + SET_EXPECT(GetBindInfo); + hres = IInternetProtocol_Start(protocol, NULL, &protocol_sink, &bind_info, 0, 0); + ok(hres == E_INVALIDARG, "Start failed: %08x, expected E_INVALIDARG\n", hres); + CHECK_CALLED(GetBindInfo); + + SET_EXPECT(GetBindInfo); + hres = IInternetProtocol_Start(protocol, emptyW, &protocol_sink, &bind_info, 0, 0); + ok(hres == E_INVALIDARG, "Start failed: %08x, expected E_INVALIDARG\n", hres); + CHECK_CALLED(GetBindInfo); + IInternetProtocol_Release(protocol); } static void test_file_protocol(void) { - WCHAR buf[MAX_PATH]; + WCHAR buf[INTERNET_MAX_URL_LENGTH], file_name_buf[MAX_PATH]; DWORD size; ULONG len; HANDLE file; @@ -1429,17 +1440,19 @@ static void test_file_protocol(void) { test_file_protocol_url(buf); memcpy(buf, wszFile2, sizeof(wszFile2)); - len = sizeof(wszFile2)/sizeof(WCHAR)-1; - len += GetCurrentDirectoryW(sizeof(buf)/sizeof(WCHAR)-len, buf+len); - buf[len++] = '\\'; - memcpy(buf+len, wszIndexHtml, sizeof(wszIndexHtml)); - - file_name = buf + sizeof(wszFile2)/sizeof(WCHAR)-1; + len = GetCurrentDirectoryW(sizeof(file_name_buf)/sizeof(WCHAR), file_name_buf); + file_name_buf[len++] = '\\'; + memcpy(file_name_buf+len, wszIndexHtml, sizeof(wszIndexHtml)); + lstrcpyW(buf+sizeof(wszFile2)/sizeof(WCHAR)-1, file_name_buf); + file_name = file_name_buf; bindf = 0; test_file_protocol_url(buf); bindf = BINDF_FROMURLMON; test_file_protocol_url(buf); + buf[sizeof(wszFile2)/sizeof(WCHAR)] = '|'; + test_file_protocol_url(buf); + memcpy(buf, wszFile3, sizeof(wszFile3)); len = sizeof(wszFile3)/sizeof(WCHAR)-1; len += GetCurrentDirectoryW(sizeof(buf)/sizeof(WCHAR)-len, buf+len); diff --git a/rostests/winetests/urlmon/urlmon.rbuild b/rostests/winetests/urlmon/urlmon.rbuild index 1bf410aba6b..77302f3d260 100644 --- a/rostests/winetests/urlmon/urlmon.rbuild +++ b/rostests/winetests/urlmon/urlmon.rbuild @@ -12,12 +12,12 @@ url.c testlist.c wine + uuid urlmon ole32 user32 advapi32 kernel32 - uuid ntdll