Commit edcaf53f authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

shell32/tests: Use strict comparison for return values.

parent 0a32123d
...@@ -47,7 +47,7 @@ static IAutoComplete *test_init(void) ...@@ -47,7 +47,7 @@ static IAutoComplete *test_init(void)
win_skip("CLSID_AutoComplete is not registered\n"); win_skip("CLSID_AutoComplete is not registered\n");
return NULL; return NULL;
} }
ok(SUCCEEDED(r), "no IID_IAutoComplete (0x%08x)\n", r); ok(r == S_OK, "no IID_IAutoComplete (0x%08x)\n", r);
/* AutoComplete source */ /* AutoComplete source */
r = CoCreateInstance(&CLSID_ACLMulti, NULL, CLSCTX_INPROC_SERVER, r = CoCreateInstance(&CLSID_ACLMulti, NULL, CLSCTX_INPROC_SERVER,
...@@ -57,7 +57,7 @@ static IAutoComplete *test_init(void) ...@@ -57,7 +57,7 @@ static IAutoComplete *test_init(void)
win_skip("CLSID_ACLMulti is not registered\n"); win_skip("CLSID_ACLMulti is not registered\n");
return NULL; return NULL;
} }
ok(SUCCEEDED(r), "no IID_IACList (0x%08x)\n", r); ok(r == S_OK, "no IID_IACList (0x%08x)\n", r);
if (0) if (0)
{ {
...@@ -66,7 +66,7 @@ if (0) ...@@ -66,7 +66,7 @@ if (0)
} }
/* bind to edit control */ /* bind to edit control */
r = IAutoComplete_Init(ac, hEdit, acSource, NULL, NULL); r = IAutoComplete_Init(ac, hEdit, acSource, NULL, NULL);
ok(SUCCEEDED(r), "Init failed (0x%08x)\n", r); ok(r == S_OK, "Init failed (0x%08x)\n", r);
IUnknown_Release(acSource); IUnknown_Release(acSource);
...@@ -126,8 +126,8 @@ START_TEST(autocomplete) ...@@ -126,8 +126,8 @@ START_TEST(autocomplete)
IAutoComplete* ac; IAutoComplete* ac;
r = CoInitialize(NULL); r = CoInitialize(NULL);
ok(SUCCEEDED(r), "CoInitialize failed (0x%08x). Tests aborted.\n", r); ok(r == S_OK, "CoInitialize failed (0x%08x). Tests aborted.\n", r);
if (FAILED(r)) if (r != S_OK)
return; return;
createMainWnd(); createMainWnd();
......
...@@ -201,7 +201,7 @@ static void loadShell32(void) ...@@ -201,7 +201,7 @@ static void loadShell32(void)
{ {
HRESULT hr = pSHGetMalloc(&pMalloc); HRESULT hr = pSHGetMalloc(&pMalloc);
ok(SUCCEEDED(hr), "SHGetMalloc failed: 0x%08x\n", hr); ok(hr == S_OK, "SHGetMalloc failed: 0x%08x\n", hr);
ok(pMalloc != NULL, "SHGetMalloc returned a NULL IMalloc\n"); ok(pMalloc != NULL, "SHGetMalloc returned a NULL IMalloc\n");
} }
...@@ -315,14 +315,14 @@ static void testSHGetFolderLocationInvalidArgs(void) ...@@ -315,14 +315,14 @@ static void testSHGetFolderLocationInvalidArgs(void)
hr = pSHGetFolderLocation(NULL, 0xeeee, NULL, 0, &pidl); hr = pSHGetFolderLocation(NULL, 0xeeee, NULL, 0, &pidl);
ok(hr == E_INVALIDARG, ok(hr == E_INVALIDARG,
"SHGetFolderLocation(NULL, 0xeeee, NULL, 0, &pidl) returned 0x%08x, expected E_INVALIDARG\n", hr); "SHGetFolderLocation(NULL, 0xeeee, NULL, 0, &pidl) returned 0x%08x, expected E_INVALIDARG\n", hr);
if (SUCCEEDED(hr)) if (hr == S_OK)
IMalloc_Free(pMalloc, pidl); IMalloc_Free(pMalloc, pidl);
/* check a bogus user token: */ /* check a bogus user token: */
pidl = NULL; pidl = NULL;
hr = pSHGetFolderLocation(NULL, CSIDL_FAVORITES, (HANDLE)2, 0, &pidl); hr = pSHGetFolderLocation(NULL, CSIDL_FAVORITES, (HANDLE)2, 0, &pidl);
ok(hr == E_FAIL || hr == E_HANDLE, ok(hr == E_FAIL || hr == E_HANDLE,
"SHGetFolderLocation(NULL, CSIDL_FAVORITES, 2, 0, &pidl) returned 0x%08x, expected E_FAIL or E_HANDLE\n", hr); "SHGetFolderLocation(NULL, CSIDL_FAVORITES, 2, 0, &pidl) returned 0x%08x, expected E_FAIL or E_HANDLE\n", hr);
if (SUCCEEDED(hr)) if (hr == S_OK)
IMalloc_Free(pMalloc, pidl); IMalloc_Free(pMalloc, pidl);
/* a NULL pidl pointer crashes, so don't test it */ /* a NULL pidl pointer crashes, so don't test it */
} }
...@@ -403,7 +403,7 @@ static BYTE testSHGetFolderLocation(int folder) ...@@ -403,7 +403,7 @@ static BYTE testSHGetFolderLocation(int folder)
pidl = NULL; pidl = NULL;
hr = pSHGetFolderLocation(NULL, folder, NULL, 0, &pidl); hr = pSHGetFolderLocation(NULL, folder, NULL, 0, &pidl);
if (SUCCEEDED(hr)) if (hr == S_OK)
{ {
if (pidl) if (pidl)
{ {
...@@ -431,7 +431,7 @@ static BYTE testSHGetSpecialFolderLocation(int folder) ...@@ -431,7 +431,7 @@ static BYTE testSHGetSpecialFolderLocation(int folder)
pidl = NULL; pidl = NULL;
hr = pSHGetSpecialFolderLocation(NULL, folder, &pidl); hr = pSHGetSpecialFolderLocation(NULL, folder, &pidl);
if (SUCCEEDED(hr)) if (hr == S_OK)
{ {
if (pidl) if (pidl)
{ {
...@@ -455,7 +455,7 @@ static void testSHGetFolderPath(BOOL optional, int folder) ...@@ -455,7 +455,7 @@ static void testSHGetFolderPath(BOOL optional, int folder)
if (!pSHGetFolderPathA) return; if (!pSHGetFolderPathA) return;
hr = pSHGetFolderPathA(NULL, folder, NULL, SHGFP_TYPE_CURRENT, path); hr = pSHGetFolderPathA(NULL, folder, NULL, SHGFP_TYPE_CURRENT, path);
ok(SUCCEEDED(hr) || optional, ok(hr == S_OK || optional,
"SHGetFolderPathA(NULL, %s, NULL, SHGFP_TYPE_CURRENT, path) failed: 0x%08x\n", getFolderName(folder), hr); "SHGetFolderPathA(NULL, %s, NULL, SHGFP_TYPE_CURRENT, path) failed: 0x%08x\n", getFolderName(folder), hr);
} }
...@@ -555,7 +555,7 @@ static void matchGUID(int folder, const GUID *guid, const GUID *guid_alt) ...@@ -555,7 +555,7 @@ static void matchGUID(int folder, const GUID *guid, const GUID *guid_alt)
pidl = NULL; pidl = NULL;
hr = pSHGetFolderLocation(NULL, folder, NULL, 0, &pidl); hr = pSHGetFolderLocation(NULL, folder, NULL, 0, &pidl);
if (SUCCEEDED(hr)) if (hr == S_OK)
{ {
LPITEMIDLIST pidlLast = pILFindLastID(pidl); LPITEMIDLIST pidlLast = pILFindLastID(pidl);
...@@ -734,7 +734,7 @@ static void testNonExistentPath1(void) ...@@ -734,7 +734,7 @@ static void testNonExistentPath1(void)
&pidl); &pidl);
ok(hr == E_FAIL || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), ok(hr == E_FAIL || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND),
"SHGetFolderLocation returned 0x%08x\n", hr); "SHGetFolderLocation returned 0x%08x\n", hr);
if (SUCCEEDED(hr) && pidl) if (hr == S_OK && pidl)
IMalloc_Free(pMalloc, pidl); IMalloc_Free(pMalloc, pidl);
ok(!pSHGetSpecialFolderPathA(NULL, path, CSIDL_FAVORITES, FALSE), ok(!pSHGetSpecialFolderPathA(NULL, path, CSIDL_FAVORITES, FALSE),
"SHGetSpecialFolderPath succeeded, expected failure\n"); "SHGetSpecialFolderPath succeeded, expected failure\n");
...@@ -742,12 +742,12 @@ static void testNonExistentPath1(void) ...@@ -742,12 +742,12 @@ static void testNonExistentPath1(void)
hr = pSHGetSpecialFolderLocation(NULL, CSIDL_FAVORITES, &pidl); hr = pSHGetSpecialFolderLocation(NULL, CSIDL_FAVORITES, &pidl);
ok(hr == E_FAIL || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), ok(hr == E_FAIL || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND),
"SHGetFolderLocation returned 0x%08x\n", hr); "SHGetFolderLocation returned 0x%08x\n", hr);
if (SUCCEEDED(hr) && pidl) if (hr == S_OK && pidl)
IMalloc_Free(pMalloc, pidl); IMalloc_Free(pMalloc, pidl);
/* now test success: */ /* now test success: */
hr = pSHGetFolderPathA(NULL, CSIDL_FAVORITES | CSIDL_FLAG_CREATE, NULL, hr = pSHGetFolderPathA(NULL, CSIDL_FAVORITES | CSIDL_FLAG_CREATE, NULL,
SHGFP_TYPE_CURRENT, path); SHGFP_TYPE_CURRENT, path);
if (SUCCEEDED(hr)) if (hr == S_OK)
{ {
BOOL ret; BOOL ret;
...@@ -769,7 +769,7 @@ static void testNonExistentPath1(void) ...@@ -769,7 +769,7 @@ static void testNonExistentPath1(void)
ret = RemoveDirectoryA(path); ret = RemoveDirectoryA(path);
ok( ret, "failed to remove %s error %u\n", path, GetLastError() ); ok( ret, "failed to remove %s error %u\n", path, GetLastError() );
} }
ok(SUCCEEDED(hr), ok(hr == S_OK,
"SHGetFolderPath(NULL, CSIDL_FAVORITES | CSIDL_FLAG_CREATE, " "SHGetFolderPath(NULL, CSIDL_FAVORITES | CSIDL_FLAG_CREATE, "
"NULL, SHGFP_TYPE_CURRENT, path) failed: 0x%08x\n", hr); "NULL, SHGFP_TYPE_CURRENT, path) failed: 0x%08x\n", hr);
} }
...@@ -784,7 +784,7 @@ static void testNonExistentPath2(void) ...@@ -784,7 +784,7 @@ static void testNonExistentPath2(void)
hr = pSHGetFolderPathA(NULL, CSIDL_FAVORITES | CSIDL_FLAG_CREATE, NULL, hr = pSHGetFolderPathA(NULL, CSIDL_FAVORITES | CSIDL_FLAG_CREATE, NULL,
SHGFP_TYPE_CURRENT, path); SHGFP_TYPE_CURRENT, path);
ok(SUCCEEDED(hr), "SHGetFolderPath failed: 0x%08x\n", hr); ok(hr == S_OK, "SHGetFolderPath failed: 0x%08x\n", hr);
} }
static void doChild(const char *arg) static void doChild(const char *arg)
......
...@@ -1854,7 +1854,7 @@ static void init_test(void) ...@@ -1854,7 +1854,7 @@ static void init_test(void)
} }
r = CoInitialize(NULL); r = CoInitialize(NULL);
ok(SUCCEEDED(r), "CoInitialize failed (0x%08x)\n", r); ok(r == S_OK, "CoInitialize failed (0x%08x)\n", r);
if (FAILED(r)) if (FAILED(r))
exit(1); exit(1);
......
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