shell32/tests: Fix test_GetDisplayName() to cope with a left-over test directory.
This commit is contained in:
parent
14712ece18
commit
f97a2f9def
|
@ -338,6 +338,7 @@ static void test_GetDisplayName(void)
|
||||||
HANDLE hTestFile;
|
HANDLE hTestFile;
|
||||||
WCHAR wszTestFile[MAX_PATH], wszTestFile2[MAX_PATH], wszTestDir[MAX_PATH];
|
WCHAR wszTestFile[MAX_PATH], wszTestFile2[MAX_PATH], wszTestDir[MAX_PATH];
|
||||||
char szTestFile[MAX_PATH], szTestDir[MAX_PATH];
|
char szTestFile[MAX_PATH], szTestDir[MAX_PATH];
|
||||||
|
DWORD attr;
|
||||||
STRRET strret;
|
STRRET strret;
|
||||||
LPSHELLFOLDER psfDesktop, psfPersonal;
|
LPSHELLFOLDER psfDesktop, psfPersonal;
|
||||||
IUnknown *psfFile;
|
IUnknown *psfFile;
|
||||||
|
@ -364,10 +365,15 @@ static void test_GetDisplayName(void)
|
||||||
|
|
||||||
PathAddBackslashW(wszTestDir);
|
PathAddBackslashW(wszTestDir);
|
||||||
lstrcatW(wszTestDir, wszDirName);
|
lstrcatW(wszTestDir, wszDirName);
|
||||||
|
/* Use ANSI file functions so this works on Windows 9x */
|
||||||
WideCharToMultiByte(CP_ACP, 0, wszTestDir, -1, szTestDir, MAX_PATH, 0, 0);
|
WideCharToMultiByte(CP_ACP, 0, wszTestDir, -1, szTestDir, MAX_PATH, 0, 0);
|
||||||
result = CreateDirectoryA(szTestDir, NULL);
|
CreateDirectoryA(szTestDir, NULL);
|
||||||
ok(result, "CreateDirectoryA failed! Last error: %u\n", GetLastError());
|
attr=GetFileAttributesA(szTestDir);
|
||||||
if (!result) return;
|
if (attr == INVALID_FILE_ATTRIBUTES || !(attr & FILE_ATTRIBUTE_DIRECTORY))
|
||||||
|
{
|
||||||
|
ok(0, "unable to create the '%s' directory\n", szTestDir);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
lstrcpyW(wszTestFile, wszTestDir);
|
lstrcpyW(wszTestFile, wszTestDir);
|
||||||
PathAddBackslashW(wszTestFile);
|
PathAddBackslashW(wszTestFile);
|
||||||
|
|
Loading…
Reference in New Issue