Huw Davies : shell32/tests: Fix the tests when run from the top directory.
Module: wine Branch: master Commit: d87aa43ce56630a5031ce492a8ac475b1ad97b75 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d87aa43ce56630a5031ce492a8... Author: Huw Davies <huw(a)codeweavers.com> Date: Thu May 15 10:27:11 2014 +0100 shell32/tests: Fix the tests when run from the top directory. --- dlls/shell32/tests/shlfolder.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index f096476..3e51c8a 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -533,12 +533,13 @@ if (0) IShellFolder_Release(psfSystemDir); - GetCurrentDirectoryA(MAX_PATH, buf); - if(!lstrlenA(buf)) + cChars = GetCurrentDirectoryA(MAX_PATH, buf); + if(!cChars) { skip("Failed to get current directory, skipping tests.\n"); return; } + if(buf[cChars-1] != '\\') lstrcatA(buf, "\\"); SHGetDesktopFolder(&psfDesktop); @@ -546,7 +547,6 @@ if (0) /* .html */ lstrcpyA(pathA, buf); - lstrcatA(pathA, "\\"); lstrcatA(pathA, filename_html); hfile = CreateFileA(pathA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); if(hfile != INVALID_HANDLE_VALUE) @@ -590,7 +590,6 @@ if (0) /* .txt */ lstrcpyA(pathA, buf); - lstrcatA(pathA, "\\"); lstrcatA(pathA, filename_txt); hfile = CreateFileA(pathA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); if(hfile != INVALID_HANDLE_VALUE) @@ -604,6 +603,7 @@ if (0) hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void**)&psfChild); ok(hr == E_FAIL || /* Vista+ */ 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 */ "Got 0x%08x\n", hr); if(SUCCEEDED(hr)) IShellFolder_Release(psfChild); @@ -616,7 +616,6 @@ if (0) /* .foo */ lstrcpyA(pathA, buf); - lstrcatA(pathA, "\\"); lstrcatA(pathA, filename_foo); hfile = CreateFileA(pathA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); if(hfile != INVALID_HANDLE_VALUE) @@ -630,6 +629,7 @@ if (0) hr = IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (void**)&psfChild); ok(hr == E_FAIL || /* Vista+ */ 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 */ "Got 0x%08x\n", hr); if(SUCCEEDED(hr)) IShellFolder_Release(psfChild);
participants (1)
-
Alexandre Julliard