[1/2] shell32/tests: Fix path comparison (try 3)
André Hentschel
nerv at dawncrow.de
Tue Sep 13 12:04:45 CDT 2011
---
dlls/shell32/tests/shlexec.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c
index bae0c21..68ff02b 100644
--- a/dlls/shell32/tests/shlexec.c
+++ b/dlls/shell32/tests/shlexec.c
@@ -2213,17 +2213,22 @@ static void test_commandline(void)
static void test_directory(void)
{
- char path[MAX_PATH], newdir[MAX_PATH];
+ char path[MAX_PATH], newdir[MAX_PATH], modulepath[MAX_PATH];
char params[1024];
int rc;
/* copy this executable to a new folder and cd to it */
sprintf(newdir, "%s\\newfolder", tmpdir);
rc = CreateDirectoryA( newdir, NULL );
- ok( rc, "failed to create %s err %u\n", path, GetLastError() );
+ ok( rc, "failed to create %s err %u\n", newdir, GetLastError() );
+
+ rc = GetModuleFileName(NULL, path, sizeof(path));
+ ok(rc && rc < sizeof(path), "GetModuleFileName failed\n");
+ sprintf(modulepath, "%s\\%s", newdir, path_find_file_name(path));
+
sprintf(path, "%s\\%s", newdir, path_find_file_name(argv0));
CopyFileA(argv0, path, FALSE);
- SetCurrentDirectory(tmpdir),
+ SetCurrentDirectory(tmpdir);
sprintf(params, "shlexec \"%s\" Exec", child_file);
@@ -2236,7 +2241,7 @@ static void test_directory(void)
ok(rc > 32, "%s returned %d\n", shell_call, rc);
okChildInt("argcA", 4);
okChildString("argvA3", "Exec");
- todo_wine okChildPath("longPath", path);
+ todo_wine okChildPath("longPath", modulepath);
DeleteFile(path);
RemoveDirectoryA(newdir);
--
Best Regards, André Hentschel
More information about the wine-patches
mailing list