shell32/tests: Create our own temp directory to make sure it's not the Windows directory.

This commit is contained in:
Alexandre Julliard 2009-07-22 23:25:25 +02:00
parent 79de2e8126
commit 7db6d5e3be
1 changed files with 9 additions and 8 deletions

View File

@ -864,8 +864,7 @@ static void test_find_executable(void)
ok(rc == SE_ERR_NOASSOC /* >= win2000 */ || rc > 32 /* win98, nt4 */, "FindExecutable(NULL) returned %ld\n", rc);
ok(strcmp(command, "your word") != 0, "FindExecutable(NULL) returned command=[%s]\n", command);
/* Win95 can't cope with double backslashes in FindExecutableA (tmpdir has a trailing backslash) */
sprintf(filename, "%stest file.sfe", tmpdir);
sprintf(filename, "%s\\test file.sfe", tmpdir);
rc=(INT_PTR)FindExecutableA(filename, NULL, command);
ok(rc > 32, "FindExecutable(%s) returned %ld\n", filename, rc);
/* Depending on the platform, command could be '%1' or 'test file.sfe' */
@ -911,10 +910,6 @@ static void test_find_executable(void)
test=filename_tests;
while (test->basename)
{
/* Win95 can't cope with double slashes/backslashes in FindExecutableA */
if (tmpdir[strlen(tmpdir) - 1] == '\\')
tmpdir[strlen(tmpdir) - 1] = 0;
sprintf(filename, test->basename, tmpdir);
if (strchr(filename, '/'))
{
@ -1527,8 +1522,13 @@ static void init_test(void)
"unable to find argv0!\n");
}
GetTempPathA(sizeof(tmpdir)/sizeof(*tmpdir), tmpdir);
assert(GetTempFileNameA(tmpdir, "wt", 0, child_file)!=0);
GetTempPathA(sizeof(filename), filename);
GetTempFileNameA(filename, "wt", 0, tmpdir);
DeleteFileA( tmpdir );
rc = CreateDirectoryA( tmpdir, NULL );
ok( rc, "failed to create %s err %u\n", tmpdir, GetLastError() );
rc = GetTempFileNameA(tmpdir, "wt", 0, child_file);
assert(rc != 0);
init_event(child_file);
/* Set up the test files */
@ -1608,6 +1608,7 @@ static void cleanup_test(void)
testfile++;
}
DeleteFile(child_file);
RemoveDirectoryA(tmpdir);
/* Delete the test association */
delete_test_association(".shlexec");