Commit e06b668f authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

mshtml/tests: Enable compilation with long types.

parent 816395e8
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = mshtml.dll
IMPORTS = ole32 oleaut32 wininet user32 urlmon gdi32 advapi32
C_SRCS = \
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -107,11 +107,11 @@ static void test_href(IHTMLLocation *loc, const struct location_test *test)
hres = IHTMLLocation_get_href(loc, NULL);
ok(hres == E_POINTER,
"%s: get_href should have failed with E_POINTER (0x%08x), was: 0x%08x\n",
"%s: get_href should have failed with E_POINTER (0x%08lx), was: 0x%08lx\n",
test->name, E_POINTER, hres);
hres = IHTMLLocation_get_href(loc, &str);
ok(hres == S_OK, "%s: get_href failed: 0x%08x\n", test->name, hres);
ok(hres == S_OK, "%s: get_href failed: 0x%08lx\n", test->name, hres);
if(hres == S_OK)
ok(str_eq_wa(str, test->href),
"%s: expected retrieved href to be L\"%s\", was: %s\n",
......@@ -119,7 +119,7 @@ static void test_href(IHTMLLocation *loc, const struct location_test *test)
SysFreeString(str);
hres = IHTMLLocation_toString(loc, &str);
ok(hres == S_OK, "%s: toString failed: 0x%08x\n", test->name, hres);
ok(hres == S_OK, "%s: toString failed: 0x%08lx\n", test->name, hres);
ok(str_eq_wa(str, test->href), "%s: toString returned %s, expected %s\n",
test->name, wine_dbgstr_w(str), test->href);
SysFreeString(str);
......@@ -132,11 +132,11 @@ static void test_protocol(IHTMLLocation *loc, const struct location_test *test)
hres = IHTMLLocation_get_protocol(loc, NULL);
ok(hres == E_POINTER,
"%s: get_protocol should have failed with E_POINTER (0x%08x), was: 0x%08x\n",
"%s: get_protocol should have failed with E_POINTER (0x%08lx), was: 0x%08lx\n",
test->name, E_POINTER, hres);
hres = IHTMLLocation_get_protocol(loc, &str);
ok(hres == S_OK, "%s: get_protocol failed: 0x%08x\n", test->name, hres);
ok(hres == S_OK, "%s: get_protocol failed: 0x%08lx\n", test->name, hres);
if(hres == S_OK)
ok(str_eq_wa(str, test->protocol),
"%s: expected retrieved protocol to be L\"%s\", was: %s\n",
......@@ -151,11 +151,11 @@ static void test_host(IHTMLLocation *loc, const struct location_test *test)
hres = IHTMLLocation_get_host(loc, NULL);
ok(hres == E_POINTER,
"%s: get_host should have failed with E_POINTER (0x%08x), was: 0x%08x\n",
"%s: get_host should have failed with E_POINTER (0x%08lx), was: 0x%08lx\n",
test->name, E_POINTER, hres);
hres = IHTMLLocation_get_host(loc, &str);
ok(hres == S_OK, "%s: get_host failed: 0x%08x\n", test->name, hres);
ok(hres == S_OK, "%s: get_host failed: 0x%08lx\n", test->name, hres);
if(hres == S_OK){
int len = test->host ? strlen(test->host) : 0;
ok(str_eq_wa(str, test->host),
......@@ -175,11 +175,11 @@ static void test_hostname(IHTMLLocation *loc, IHTMLDocument2 *doc, const struct
hres = IHTMLLocation_get_hostname(loc, NULL);
ok(hres == E_POINTER,
"%s: get_hostname should have failed with E_POINTER (0x%08x), was: 0x%08x\n",
"%s: get_hostname should have failed with E_POINTER (0x%08lx), was: 0x%08lx\n",
test->name, E_POINTER, hres);
hres = IHTMLLocation_get_hostname(loc, &str);
ok(hres == S_OK, "%s: get_hostname failed: 0x%08x\n", test->name, hres);
ok(hres == S_OK, "%s: get_hostname failed: 0x%08lx\n", test->name, hres);
if(hres == S_OK)
ok(str_eq_wa(str, test->hostname),
"%s: expected retrieved hostname to be L\"%s\", was: %s\n",
......@@ -187,7 +187,7 @@ static void test_hostname(IHTMLLocation *loc, IHTMLDocument2 *doc, const struct
SysFreeString(str);
hres = IHTMLDocument2_get_domain(doc, &str);
ok(hres == S_OK, "%s: get_domain failed: 0x%08x\n", test->name, hres);
ok(hres == S_OK, "%s: get_domain failed: 0x%08lx\n", test->name, hres);
if(hres == S_OK)
ok(str_eq_wa(str, test->hostname ? test->hostname : ""),
"%s: expected retrieved domain to be L\"%s\", was: %s\n",
......@@ -202,11 +202,11 @@ static void test_port(IHTMLLocation *loc, const struct location_test *test)
hres = IHTMLLocation_get_port(loc, NULL);
ok(hres == E_POINTER,
"%s: get_port should have failed with E_POINTER (0x%08x), was: 0x%08x\n",
"%s: get_port should have failed with E_POINTER (0x%08lx), was: 0x%08lx\n",
test->name, E_POINTER, hres);
hres = IHTMLLocation_get_port(loc, &str);
ok(hres == S_OK, "%s: get_port failed: 0x%08x\n", test->name, hres);
ok(hres == S_OK, "%s: get_port failed: 0x%08lx\n", test->name, hres);
if(hres == S_OK)
ok(str_eq_wa(str, test->port)
|| (!str && !*test->port), /* IE11 */
......@@ -222,11 +222,11 @@ static void test_pathname(IHTMLLocation *loc, const struct location_test *test)
hres = IHTMLLocation_get_pathname(loc, NULL);
ok(hres == E_POINTER,
"%s: get_pathname should have failed with E_POINTER (0x%08x), was: 0x%08x\n",
"%s: get_pathname should have failed with E_POINTER (0x%08lx), was: 0x%08lx\n",
test->name, E_POINTER, hres);
hres = IHTMLLocation_get_pathname(loc, &str);
ok(hres == S_OK, "%s: get_pathname failed: 0x%08x\n", test->name, hres);
ok(hres == S_OK, "%s: get_pathname failed: 0x%08lx\n", test->name, hres);
if(hres == S_OK)
/* FIXME: We seem to be testing location in a buggy state. Path names do not
* include leading slash, while other tests confirm that it should be there */
......@@ -244,11 +244,11 @@ static void test_search(IHTMLLocation *loc, const struct location_test *test)
hres = IHTMLLocation_get_search(loc, NULL);
ok(hres == E_POINTER,
"%s: get_search should have failed with E_POINTER (0x%08x), was: 0x%08x\n",
"%s: get_search should have failed with E_POINTER (0x%08lx), was: 0x%08lx\n",
test->name, E_POINTER, hres);
hres = IHTMLLocation_get_search(loc, &str);
ok(hres == S_OK, "%s: get_search failed: 0x%08x\n", test->name, hres);
ok(hres == S_OK, "%s: get_search failed: 0x%08lx\n", test->name, hres);
if(hres == S_OK)
ok(str_eq_wa(str, test->search),
"%s: expected retrieved search to be L\"%s\", was: %s\n",
......@@ -263,11 +263,11 @@ static void test_hash(IHTMLLocation *loc, const struct location_test *test)
hres = IHTMLLocation_get_hash(loc, NULL);
ok(hres == E_POINTER,
"%s: get_hash should have failed with E_POINTER (0x%08x), was: 0x%08x\n",
"%s: get_hash should have failed with E_POINTER (0x%08lx), was: 0x%08lx\n",
test->name, E_POINTER, hres);
hres = IHTMLLocation_get_hash(loc, &str);
ok(hres == S_OK, "%s: get_hash failed: 0x%08x\n", test->name, hres);
ok(hres == S_OK, "%s: get_hash failed: 0x%08lx\n", test->name, hres);
if(hres == S_OK)
ok(str_eq_wa(str, test->hash),
"%s: expected retrieved hash to be L\"%s\", was: %s\n",
......@@ -287,13 +287,13 @@ static void perform_test(const struct location_test* test)
IHTMLLocation *location;
hres = CreateBindCtx(0, &bc);
ok(hres == S_OK, "%s: CreateBindCtx failed: 0x%08x\n", test->name, hres);
ok(hres == S_OK, "%s: CreateBindCtx failed: 0x%08lx\n", test->name, hres);
if(FAILED(hres))
return;
MultiByteToWideChar(CP_ACP, 0, test->url, -1, url, ARRAY_SIZE(url));
hres = CreateURLMoniker(NULL, url, &url_mon);
ok(hres == S_OK, "%s: CreateURLMoniker failed: 0x%08x\n", test->name, hres);
ok(hres == S_OK, "%s: CreateURLMoniker failed: 0x%08lx\n", test->name, hres);
if(FAILED(hres)){
IBindCtx_Release(bc);
return;
......@@ -305,7 +305,7 @@ static void perform_test(const struct location_test* test)
#if !defined(__i386__) && !defined(__x86_64__)
todo_wine
#endif
ok(hres == S_OK, "%s: CoCreateInstance failed: 0x%08x\n", test->name, hres);
ok(hres == S_OK, "%s: CoCreateInstance failed: 0x%08lx\n", test->name, hres);
if(FAILED(hres)){
IMoniker_Release(url_mon);
IBindCtx_Release(bc);
......@@ -324,7 +324,7 @@ static void perform_test(const struct location_test* test)
hres = IHTMLDocument2_QueryInterface(doc, &IID_IPersistMoniker,
(void**)&persist_mon);
ok(hres == S_OK, "%s: IHTMlDocument2_QueryInterface failed: 0x%08x\n", test->name, hres);
ok(hres == S_OK, "%s: IHTMlDocument2_QueryInterface failed: 0x%08lx\n", test->name, hres);
if(FAILED(hres)){
IHTMLDocument2_Release(doc);
IMoniker_Release(url_mon);
......@@ -334,7 +334,7 @@ static void perform_test(const struct location_test* test)
hres = IPersistMoniker_Load(persist_mon, FALSE, url_mon, bc,
STGM_SHARE_EXCLUSIVE | STGM_READWRITE);
ok(hres == S_OK, "%s: IPersistMoniker_Load failed: 0x%08x\n", test->name, hres);
ok(hres == S_OK, "%s: IPersistMoniker_Load failed: 0x%08lx\n", test->name, hres);
if(FAILED(hres)){
IPersistMoniker_Release(persist_mon);
IHTMLDocument2_Release(doc);
......@@ -344,7 +344,7 @@ static void perform_test(const struct location_test* test)
}
hres = IHTMLDocument2_get_location(doc, &location);
ok(hres == S_OK, "%s: IHTMLDocument2_get_location failed: 0x%08x\n", test->name, hres);
ok(hres == S_OK, "%s: IHTMLDocument2_get_location failed: 0x%08lx\n", test->name, hres);
if(FAILED(hres)){
IPersistMoniker_Release(persist_mon);
IHTMLDocument2_Release(doc);
......
......@@ -36,7 +36,7 @@ static void test_HTMLLoadOptions(void)
hres = CoCreateInstance(&CLSID_HTMLLoadOptions, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IHtmlLoadOptions, (void**)&loadopts);
ok(hres == S_OK, "creating HTMLLoadOptions failed: %08x\n", hres);
ok(hres == S_OK, "creating HTMLLoadOptions failed: %08lx\n", hres);
if(FAILED(hres))
return;
......@@ -44,64 +44,64 @@ static void test_HTMLLoadOptions(void)
size = 0xdeadbeef;
memset(buf, 0xdd, sizeof(buf));
hres = IHtmlLoadOptions_QueryOption(loadopts, i, NULL, &size);
ok(hres == S_OK, "QueryOption failed: %08x\n", hres);
ok(size == 0, "size = %d\n", size);
ok(hres == S_OK, "QueryOption failed: %08lx\n", hres);
ok(size == 0, "size = %ld\n", size);
ok(buf[0] == 0xdd, "buf changed\n");
}
size = 0xdeadbeef;
hres = IHtmlLoadOptions_QueryOption(loadopts, HTMLLOADOPTION_CODEPAGE, NULL, &size);
ok(hres == S_OK, "QueryOption failed: %08x\n", hres);
ok(size == 0, "size = %d\n", size);
ok(hres == S_OK, "QueryOption failed: %08lx\n", hres);
ok(size == 0, "size = %ld\n", size);
hres = IHtmlLoadOptions_SetOption(loadopts, HTMLLOADOPTION_CODEPAGE, &data, sizeof(data));
ok(hres == S_OK, "SetOption failed: %08x\n", hres);
ok(hres == S_OK, "SetOption failed: %08lx\n", hres);
size = sizeof(data);
memset(buf, 0xdd, sizeof(buf));
hres = IHtmlLoadOptions_QueryOption(loadopts, HTMLLOADOPTION_CODEPAGE, buf, &size);
ok(hres == S_OK, "QueryOption failed: %08x\n", hres);
ok(size == sizeof(data), "size = %d\n", size);
ok(hres == S_OK, "QueryOption failed: %08lx\n", hres);
ok(size == sizeof(data), "size = %ld\n", size);
ok(*(DWORD*)buf == data, "unexpected buf\n");
size = sizeof(data)-1;
memset(buf, 0xdd, sizeof(buf));
hres = IHtmlLoadOptions_QueryOption(loadopts, HTMLLOADOPTION_CODEPAGE, buf, &size);
ok(hres == E_FAIL, "QueryOption failed: %08x\n", hres);
ok(size == sizeof(data) || !size, "size = %d\n", size);
ok(hres == E_FAIL, "QueryOption failed: %08lx\n", hres);
ok(size == sizeof(data) || !size, "size = %ld\n", size);
ok(buf[0] == 0xdd, "buf changed\n");
data = 100;
hres = IHtmlLoadOptions_SetOption(loadopts, HTMLLOADOPTION_CODEPAGE, &data, 0);
ok(hres == S_OK, "SetOption failed: %08x\n", hres);
ok(hres == S_OK, "SetOption failed: %08lx\n", hres);
size = 0xdeadbeef;
memset(buf, 0xdd, sizeof(buf));
hres = IHtmlLoadOptions_QueryOption(loadopts, HTMLLOADOPTION_CODEPAGE, buf, &size);
ok(hres == S_OK, "QueryOption failed: %08x\n", hres);
ok(size == 0, "size = %d\n", size);
ok(hres == S_OK, "QueryOption failed: %08lx\n", hres);
ok(size == 0, "size = %ld\n", size);
ok(buf[0] == 0xdd, "buf changed\n");
hres = IHtmlLoadOptions_SetOption(loadopts, HTMLLOADOPTION_CODEPAGE, NULL, 0);
ok(hres == S_OK, "SetOption failed: %08x\n", hres);
ok(hres == S_OK, "SetOption failed: %08lx\n", hres);
hres = IHtmlLoadOptions_SetOption(loadopts, 1000, &data, sizeof(data));
ok(hres == S_OK, "SetOption failed: %08x\n", hres);
ok(hres == S_OK, "SetOption failed: %08lx\n", hres);
size = sizeof(data);
memset(buf, 0xdd, sizeof(buf));
hres = IHtmlLoadOptions_QueryOption(loadopts, 1000, buf, &size);
ok(hres == S_OK, "QueryOption failed: %08x\n", hres);
ok(size == sizeof(data), "size = %d\n", size);
ok(hres == S_OK, "QueryOption failed: %08lx\n", hres);
ok(size == sizeof(data), "size = %ld\n", size);
ok(*(DWORD*)buf == data, "unexpected buf\n");
hres = IHtmlLoadOptions_SetOption(loadopts, 1000, buf, sizeof(buf));
ok(hres == S_OK, "SetOption failed: %08x\n", hres);
ok(hres == S_OK, "SetOption failed: %08lx\n", hres);
size = 0xdeadbeef;
hres = IHtmlLoadOptions_QueryOption(loadopts, 1000, buf, &size);
ok(hres == S_OK, "QueryOption failed: %08x\n", hres);
ok(size == sizeof(buf), "size = %d\n", size);
ok(hres == S_OK, "QueryOption failed: %08lx\n", hres);
ok(size == sizeof(buf), "size = %ld\n", size);
IHtmlLoadOptions_Release(loadopts);
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment