Module: wine Branch: master Commit: 437a3aab9d095f5940ffc776629b33dfe7250f42 URL: http://source.winehq.org/git/wine.git/?a=commit;h=437a3aab9d095f5940ffc77662...
Author: Paul Vriens paul.vriens.wine@gmail.com Date: Sat May 19 22:34:43 2007 +0200
advpack/tests: Don't hardcode the system directory.
---
dlls/advpack/tests/install.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/advpack/tests/install.c b/dlls/advpack/tests/install.c index deac91a..7f83cf8 100644 --- a/dlls/advpack/tests/install.c +++ b/dlls/advpack/tests/install.c @@ -86,6 +86,9 @@ static void test_RunSetupCommand(void) HANDLE hexe; char path[MAX_PATH]; char dir[MAX_PATH]; + char systemdir[MAX_PATH]; + + GetSystemDirectoryA(systemdir, sizeof(systemdir));
/* try an invalid cmd name */ hr = pRunSetupCommand(NULL, NULL, "Install", "Dir", "Title", NULL, 0, NULL); @@ -97,7 +100,7 @@ static void test_RunSetupCommand(void)
/* try to run a nonexistent exe */ hexe = (HANDLE)0xdeadbeef; - hr = pRunSetupCommand(NULL, "idontexist.exe", "Install", "c:\windows\system32", "Title", &hexe, 0, NULL); + hr = pRunSetupCommand(NULL, "idontexist.exe", "Install", systemdir, "Title", &hexe, 0, NULL); ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %d\n", hr); ok(hexe == NULL, "Expcted hexe to be NULL\n"); @@ -113,14 +116,14 @@ static void test_RunSetupCommand(void)
/* try to run an exe with the RSC_FLAG_INF flag */ hexe = (HANDLE)0xdeadbeef; - hr = pRunSetupCommand(NULL, "winver.exe", "Install", "c:\windows\system32", "Title", &hexe, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL); + hr = pRunSetupCommand(NULL, "winver.exe", "Install", systemdir, "Title", &hexe, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL); ok(is_spapi_err(hr), "Expected a setupapi error, got %d\n", hr); ok(hexe == (HANDLE)0xdeadbeef, "Expected hexe to be 0xdeadbeef\n"); ok(!TerminateProcess(hexe, 0), "Expected TerminateProcess to fail\n");
/* run winver.exe */ hexe = (HANDLE)0xdeadbeef; - hr = pRunSetupCommand(NULL, "winver.exe", "Install", "c:\windows\system32", "Title", &hexe, 0, NULL); + hr = pRunSetupCommand(NULL, "winver.exe", "Install", systemdir, "Title", &hexe, 0, NULL); ok(hr == S_ASYNCHRONOUS, "Expected S_ASYNCHRONOUS, got %d\n", hr); ok(hexe != NULL, "Expected hexe to be non-NULL\n"); ok(TerminateProcess(hexe, 0), "Expected TerminateProcess to succeed\n");