Commit 29ce9a1f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

shdocvw: Clean tests skipping.

parent c6dba02e
...@@ -120,15 +120,12 @@ static void test_QueryInterface(void) ...@@ -120,15 +120,12 @@ static void test_QueryInterface(void)
IUnknown *pUnknown; IUnknown *pUnknown;
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUnknown, (void**)&pUnknown); hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUnknown, (void**)&pUnknown);
if (SUCCEEDED(hr)) ok(hr == S_OK, "Could not create InternetShortcut object: %08x\n", hr);
{
can_query_interface(pUnknown, &IID_IUniformResourceLocatorA); can_query_interface(pUnknown, &IID_IUniformResourceLocatorA);
can_query_interface(pUnknown, &IID_IUniformResourceLocatorW); can_query_interface(pUnknown, &IID_IUniformResourceLocatorW);
can_query_interface(pUnknown, &IID_IPersistFile); can_query_interface(pUnknown, &IID_IPersistFile);
IUnknown_Release(pUnknown); IUnknown_Release(pUnknown);
}
else
skip("could not create a CLSID_InternetShortcut for QueryInterface tests, hr=0x%x\n", hr);
} }
static CHAR *set_and_get_url(IUniformResourceLocatorA *urlA, LPCSTR input, DWORD flags) static CHAR *set_and_get_url(IUniformResourceLocatorA *urlA, LPCSTR input, DWORD flags)
...@@ -176,15 +173,17 @@ static BOOL check_ie(void) ...@@ -176,15 +173,17 @@ static BOOL check_ie(void)
static void test_ReadAndWriteProperties(void) static void test_ReadAndWriteProperties(void)
{ {
int iconIndex = 7;
PROPSPEC ps[2];
HRESULT hr; HRESULT hr;
IUniformResourceLocatorA *urlA; IUniformResourceLocatorA *urlA;
IUniformResourceLocatorA *urlAFromFile; IUniformResourceLocatorA *urlAFromFile;
WCHAR fileNameW[MAX_PATH]; WCHAR fileNameW[MAX_PATH];
static const WCHAR shortcutW[] = {'t','e','s','t','s','h','o','r','t','c','u','t','.','u','r','l',0}; static const WCHAR shortcutW[] = {'t','e','s','t','s','h','o','r','t','c','u','t','.','u','r','l',0};
WCHAR iconPath[] = {'f','i','l','e',':','/','/','/','C',':','/','a','r','b','i','t','r','a','r','y','/','i','c','o','n','/','p','a','t','h',0}; WCHAR iconPath[] = {'f','i','l','e',':','/','/','/','C',':','/','a','r','b','i','t','r','a','r','y','/','i','c','o','n','/','p','a','t','h',0};
int iconIndex = 7;
char testurl[] = "http://some/bogus/url.html"; char testurl[] = "http://some/bogus/url.html";
PROPSPEC ps[2];
ps[0].ulKind = PRSPEC_PROPID; ps[0].ulKind = PRSPEC_PROPID;
U(ps[0]).propid = PID_IS_ICONFILE; U(ps[0]).propid = PID_IS_ICONFILE;
ps[1].ulKind = PRSPEC_PROPID; ps[1].ulKind = PRSPEC_PROPID;
...@@ -290,13 +289,12 @@ static void test_ReadAndWriteProperties(void) ...@@ -290,13 +289,12 @@ static void test_ReadAndWriteProperties(void)
static void test_NullURLs(void) static void test_NullURLs(void)
{ {
LPSTR url = NULL;
HRESULT hr; HRESULT hr;
IUniformResourceLocatorA *urlA; IUniformResourceLocatorA *urlA;
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&urlA); hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&urlA);
if (SUCCEEDED(hr)) ok(hr == S_OK, "Could not create InternetShortcut object: %08x\n", hr);
{
LPSTR url = NULL;
hr = urlA->lpVtbl->GetURL(urlA, &url); hr = urlA->lpVtbl->GetURL(urlA, &url);
ok(SUCCEEDED(hr), "getting uninitialized URL unexpectedly failed, hr=0x%x\n", hr); ok(SUCCEEDED(hr), "getting uninitialized URL unexpectedly failed, hr=0x%x\n", hr);
...@@ -310,9 +308,6 @@ static void test_NullURLs(void) ...@@ -310,9 +308,6 @@ static void test_NullURLs(void)
ok(url == NULL, "URL unexpectedly not NULL but %s\n", url); ok(url == NULL, "URL unexpectedly not NULL but %s\n", url);
urlA->lpVtbl->Release(urlA); urlA->lpVtbl->Release(urlA);
}
else
skip("could not create a CLSID_InternetShortcut for NullURL tests, hr=0x%x\n", hr);
} }
static void test_SetURLFlags(void) static void test_SetURLFlags(void)
...@@ -321,38 +316,45 @@ static void test_SetURLFlags(void) ...@@ -321,38 +316,45 @@ static void test_SetURLFlags(void)
IUniformResourceLocatorA *urlA; IUniformResourceLocatorA *urlA;
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&urlA); hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&urlA);
if (SUCCEEDED(hr)) ok(hr == S_OK, "Could not create InternetShortcut object: %08x\n", hr);
{
check_string_transform(urlA, "somerandomstring", 0, "somerandomstring"); check_string_transform(urlA, "somerandomstring", 0, "somerandomstring");
check_string_transform(urlA, "www.winehq.org", 0, "www.winehq.org"); check_string_transform(urlA, "www.winehq.org", 0, "www.winehq.org");
todo_wine todo_wine
{
check_string_transform(urlA, "www.winehq.org", IURL_SETURL_FL_GUESS_PROTOCOL, "http://www.winehq.org/"); check_string_transform(urlA, "www.winehq.org", IURL_SETURL_FL_GUESS_PROTOCOL, "http://www.winehq.org/");
todo_wine
check_string_transform(urlA, "ftp.winehq.org", IURL_SETURL_FL_GUESS_PROTOCOL, "ftp://ftp.winehq.org/"); check_string_transform(urlA, "ftp.winehq.org", IURL_SETURL_FL_GUESS_PROTOCOL, "ftp://ftp.winehq.org/");
}
urlA->lpVtbl->Release(urlA); urlA->lpVtbl->Release(urlA);
}
else
skip("could not create a CLSID_InternetShortcut for SetUrl tests, hr=0x%x\n", hr);
} }
static void test_InternetShortcut(void) static void test_InternetShortcut(void)
{ {
if (check_ie()) IUniformResourceLocatorA *url;
{ HRESULT hres;
hres = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&url);
if(FAILED(hres)) {
win_skip("Could not create CLSID_InternetShortcut instance: %08x\n", hres);
return;
}
test_Aggregability(); test_Aggregability();
test_QueryInterface(); test_QueryInterface();
test_NullURLs(); test_NullURLs();
test_SetURLFlags(); test_SetURLFlags();
test_ReadAndWriteProperties(); test_ReadAndWriteProperties();
}
} }
START_TEST(intshcut) START_TEST(intshcut)
{ {
OleInitialize(NULL); OleInitialize(NULL);
if(check_ie())
test_InternetShortcut(); test_InternetShortcut();
else
win_skip("Too old IE\n");
OleUninitialize(); OleUninitialize();
} }
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