From 0eeb547d431642143b3b9c80378cafb3d38ca685 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 31 Jul 2008 15:45:02 -0700 Subject: [PATCH 1/2] shell32: Add a test for FindExecutableA. --- dlls/shell32/tests/shlexec.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index 644d611..0b7eb2a 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -836,6 +836,23 @@ static void test_find_executable(void) char command[MAX_PATH]; const filename_tests_t* test; int rc; + HANDLE file; + + { + char expand[MAX_PATH]; + strcpy(command, "foobar"); + strcpy(filename, "foo.msi"); + file = CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", filename); + CloseHandle(file); + + ok(ExpandEnvironmentStringsA("\%systemroot\%\\system32\\msiexec.exe", expand, MAX_PATH) != 0, "ExpandEnvironmentStringsA failed\n"); + rc = (int)FindExecutableA(filename, NULL, command); + ok(rc > 32, "FindExecutableA returned %d\n", rc); + todo_wine ok(0 == lstrcmpi(expand, command), "FindExecutable returned the wrong result for foo.msi, expected %s, got %s\n", expand, command); + + ok(DeleteFileA(filename), "Error deleting %s\n", filename); + } if (!create_test_association(".sfe")) { -- 1.5.4.5