Commit d87aa43c authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

shell32/tests: Fix the tests when run from the top directory.

parent 04af7227
...@@ -533,12 +533,13 @@ if (0) ...@@ -533,12 +533,13 @@ if (0)
IShellFolder_Release(psfSystemDir); IShellFolder_Release(psfSystemDir);
GetCurrentDirectoryA(MAX_PATH, buf); cChars = GetCurrentDirectoryA(MAX_PATH, buf);
if(!lstrlenA(buf)) if(!cChars)
{ {
skip("Failed to get current directory, skipping tests.\n"); skip("Failed to get current directory, skipping tests.\n");
return; return;
} }
if(buf[cChars-1] != '\\') lstrcatA(buf, "\\");
SHGetDesktopFolder(&psfDesktop); SHGetDesktopFolder(&psfDesktop);
...@@ -546,7 +547,6 @@ if (0) ...@@ -546,7 +547,6 @@ if (0)
/* .html */ /* .html */
lstrcpyA(pathA, buf); lstrcpyA(pathA, buf);
lstrcatA(pathA, "\\");
lstrcatA(pathA, filename_html); lstrcatA(pathA, filename_html);
hfile = CreateFileA(pathA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); hfile = CreateFileA(pathA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
if(hfile != INVALID_HANDLE_VALUE) if(hfile != INVALID_HANDLE_VALUE)
...@@ -590,7 +590,6 @@ if (0) ...@@ -590,7 +590,6 @@ if (0)
/* .txt */ /* .txt */
lstrcpyA(pathA, buf); lstrcpyA(pathA, buf);
lstrcatA(pathA, "\\");
lstrcatA(pathA, filename_txt); lstrcatA(pathA, filename_txt);
hfile = CreateFileA(pathA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); hfile = CreateFileA(pathA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
if(hfile != INVALID_HANDLE_VALUE) if(hfile != INVALID_HANDLE_VALUE)
...@@ -604,6 +603,7 @@ if (0) ...@@ -604,6 +603,7 @@ if (0)
hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void**)&psfChild); hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void**)&psfChild);
ok(hr == E_FAIL || /* Vista+ */ ok(hr == E_FAIL || /* Vista+ */
hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || /* XP, W2K3 */ hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || /* XP, W2K3 */
hr == E_INVALIDARG || /* W2K item in top dir */
broken(hr == S_OK), /* Win9x, NT4, W2K */ broken(hr == S_OK), /* Win9x, NT4, W2K */
"Got 0x%08x\n", hr); "Got 0x%08x\n", hr);
if(SUCCEEDED(hr)) IShellFolder_Release(psfChild); if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
...@@ -616,7 +616,6 @@ if (0) ...@@ -616,7 +616,6 @@ if (0)
/* .foo */ /* .foo */
lstrcpyA(pathA, buf); lstrcpyA(pathA, buf);
lstrcatA(pathA, "\\");
lstrcatA(pathA, filename_foo); lstrcatA(pathA, filename_foo);
hfile = CreateFileA(pathA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); hfile = CreateFileA(pathA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
if(hfile != INVALID_HANDLE_VALUE) if(hfile != INVALID_HANDLE_VALUE)
...@@ -630,6 +629,7 @@ if (0) ...@@ -630,6 +629,7 @@ if (0)
hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void**)&psfChild); hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void**)&psfChild);
ok(hr == E_FAIL || /* Vista+ */ ok(hr == E_FAIL || /* Vista+ */
hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || /* XP, W2K3 */ hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || /* XP, W2K3 */
hr == E_INVALIDARG || /* W2K item in top dir */
broken(hr == S_OK), /* Win9x, NT4, W2K */ broken(hr == S_OK), /* Win9x, NT4, W2K */
"Got 0x%08x\n", hr); "Got 0x%08x\n", hr);
if(SUCCEEDED(hr)) IShellFolder_Release(psfChild); if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
......
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