[ADVPACK_WINETEST]

* Sync to Wine 1.3.37.

svn path=/trunk/; revision=55098
This commit is contained in:
Amine Khaldi 2012-01-23 12:26:48 +00:00
parent 7b65a2d418
commit 0a0e949048
3 changed files with 16 additions and 30 deletions

View file

@ -130,7 +130,7 @@ static void delnode_test(void)
HRESULT hr; HRESULT hr;
HANDLE hn; HANDLE hn;
CHAR currDir[MAX_PATH]; CHAR currDir[MAX_PATH];
int currDirLen; UINT currDirLen;
/* Native DelNode apparently does not support relative paths, so we use /* Native DelNode apparently does not support relative paths, so we use
absolute paths for testing */ absolute paths for testing */
@ -446,7 +446,7 @@ static void translateinfstringex_test(void)
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
ok(!lstrcmpi(buffer, PROG_FILES_ROOT), ok(!lstrcmpi(buffer, PROG_FILES_ROOT),
"Expected %s, got %s\n", PROG_FILES_ROOT, buffer); "Expected %s, got %s\n", PROG_FILES_ROOT, buffer);
ok(size == lstrlenA(PROG_FILES_ROOT)+1, "Expected size %d, got %d\n", ok(size == strlen(PROG_FILES_ROOT)+1, "Expected size %d, got %d\n",
lstrlenA(PROG_FILES_ROOT)+1, size); lstrlenA(PROG_FILES_ROOT)+1, size);
memset(buffer, 'a', APP_PATH_LEN); memset(buffer, 'a', APP_PATH_LEN);
@ -457,7 +457,7 @@ static void translateinfstringex_test(void)
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
ok(!lstrcmpi(buffer, PROG_FILES_ROOT), ok(!lstrcmpi(buffer, PROG_FILES_ROOT),
"Expected %s, got %s\n", PROG_FILES_ROOT, buffer); "Expected %s, got %s\n", PROG_FILES_ROOT, buffer);
ok(size == lstrlenA(PROG_FILES_ROOT)+1, "Expected size %d, got %d\n", ok(size == strlen(PROG_FILES_ROOT)+1, "Expected size %d, got %d\n",
lstrlenA(PROG_FILES_ROOT)+1, size); lstrlenA(PROG_FILES_ROOT)+1, size);
{ {
@ -473,7 +473,7 @@ static void translateinfstringex_test(void)
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
ok(!lstrcmpi(buffer, drive), ok(!lstrcmpi(buffer, drive),
"Expected %s, got %s\n", drive, buffer); "Expected %s, got %s\n", drive, buffer);
ok(size == lstrlenA(drive)+1, "Expected size %d, got %d\n", ok(size == strlen(drive)+1, "Expected size %d, got %d\n",
lstrlenA(drive)+1, size); lstrlenA(drive)+1, size);
} }
@ -531,7 +531,7 @@ static void translateinfstringex_test(void)
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
ok(!lstrcmpi(buffer, PROG_FILES_ROOT), ok(!lstrcmpi(buffer, PROG_FILES_ROOT),
"Expected %s, got %s\n", PROG_FILES_ROOT, buffer); "Expected %s, got %s\n", PROG_FILES_ROOT, buffer);
ok(size == lstrlenA(PROG_FILES_ROOT)+1, "Expected size %d, got %d\n", ok(size == strlen(PROG_FILES_ROOT)+1, "Expected size %d, got %d\n",
lstrlenA(PROG_FILES_ROOT)+1, size); lstrlenA(PROG_FILES_ROOT)+1, size);
/* close the INF again */ /* close the INF again */

View file

@ -29,12 +29,12 @@
#define FOLDER_THRESHOLD 900000 #define FOLDER_THRESHOLD 900000
/* function pointers */ /* function pointers */
HMODULE hAdvPack; static HMODULE hAdvPack;
static HRESULT (WINAPI *pAddDelBackupEntry)(LPCSTR, LPCSTR, LPCSTR, DWORD); static HRESULT (WINAPI *pAddDelBackupEntry)(LPCSTR, LPCSTR, LPCSTR, DWORD);
static HRESULT (WINAPI *pExtractFiles)(LPCSTR, LPCSTR, DWORD, LPCSTR, LPVOID, DWORD); static HRESULT (WINAPI *pExtractFiles)(LPCSTR, LPCSTR, DWORD, LPCSTR, LPVOID, DWORD);
static HRESULT (WINAPI *pAdvInstallFile)(HWND,LPCSTR,LPCSTR,LPCSTR,LPCSTR,DWORD,DWORD); static HRESULT (WINAPI *pAdvInstallFile)(HWND,LPCSTR,LPCSTR,LPCSTR,LPCSTR,DWORD,DWORD);
CHAR CURR_DIR[MAX_PATH]; static CHAR CURR_DIR[MAX_PATH];
static void init_function_pointers(void) static void init_function_pointers(void)
{ {

View file

@ -95,7 +95,7 @@ static void test_RunSetupCommand(void)
hr = pRunSetupCommand(NULL, "idontexist.exe", "Install", systemdir, "Title", &hexe, 0, NULL); hr = pRunSetupCommand(NULL, "idontexist.exe", "Install", systemdir, "Title", &hexe, 0, NULL);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND),
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %d\n", hr); "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %d\n", hr);
ok(hexe == NULL, "Expcted hexe to be NULL\n"); ok(hexe == NULL, "Expected hexe to be NULL\n");
ok(!TerminateProcess(hexe, 0), "Expected TerminateProcess to fail\n"); ok(!TerminateProcess(hexe, 0), "Expected TerminateProcess to fail\n");
/* try a bad directory */ /* try a bad directory */
@ -103,15 +103,13 @@ static void test_RunSetupCommand(void)
hr = pRunSetupCommand(NULL, "winver.exe", "Install", "non\\existent\\directory", "Title", &hexe, 0, NULL); hr = pRunSetupCommand(NULL, "winver.exe", "Install", "non\\existent\\directory", "Title", &hexe, 0, NULL);
ok(hr == HRESULT_FROM_WIN32(ERROR_DIRECTORY), ok(hr == HRESULT_FROM_WIN32(ERROR_DIRECTORY),
"Expected HRESULT_FROM_WIN32(ERROR_DIRECTORY), got %d\n", hr); "Expected HRESULT_FROM_WIN32(ERROR_DIRECTORY), got %d\n", hr);
ok(hexe == NULL, "Expcted hexe to be NULL\n"); ok(hexe == NULL, "Expected hexe to be NULL\n");
ok(!TerminateProcess(hexe, 0), "Expected TerminateProcess to fail\n"); ok(!TerminateProcess(hexe, 0), "Expected TerminateProcess to fail\n");
/* try to run an exe with the RSC_FLAG_INF flag */ /* try to run an exe with the RSC_FLAG_INF flag */
hexe = (HANDLE)0xdeadbeef; hexe = (HANDLE)0xdeadbeef;
hr = pRunSetupCommand(NULL, "winver.exe", "Install", systemdir, "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) || ok(is_spapi_err(hr), "Expected a setupapi error, got %d\n", hr);
hr == E_FAIL, /* win9x */
"Expected a setupapi error or E_FAIL, got %d\n", hr);
ok(hexe == (HANDLE)0xdeadbeef, "Expected hexe to be 0xdeadbeef\n"); ok(hexe == (HANDLE)0xdeadbeef, "Expected hexe to be 0xdeadbeef\n");
ok(!TerminateProcess(hexe, 0), "Expected TerminateProcess to fail\n"); ok(!TerminateProcess(hexe, 0), "Expected TerminateProcess to fail\n");
@ -144,9 +142,7 @@ static void test_RunSetupCommand(void)
/* try a relative path to the INF, with working dir provided */ /* try a relative path to the INF, with working dir provided */
hr = pRunSetupCommand(NULL, "one\\test.inf", "DefaultInstall", dir, "Title", NULL, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL); hr = pRunSetupCommand(NULL, "one\\test.inf", "DefaultInstall", dir, "Title", NULL, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL);
ok(hr == ERROR_SUCCESS || ok(hr == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", hr);
hr == E_FAIL, /* win9x */
"Expected ERROR_SUCCESS, got %d\n", hr);
/* try a relative path to the INF, NULL working dir */ /* try a relative path to the INF, NULL working dir */
hr = pRunSetupCommand(NULL, "one\\test.inf", "DefaultInstall", NULL, "Title", NULL, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL); hr = pRunSetupCommand(NULL, "one\\test.inf", "DefaultInstall", NULL, "Title", NULL, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL);
@ -155,15 +151,11 @@ static void test_RunSetupCommand(void)
/* try a relative path to the INF, empty working dir */ /* try a relative path to the INF, empty working dir */
hr = pRunSetupCommand(NULL, "one\\test.inf", "DefaultInstall", "", "Title", NULL, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL); hr = pRunSetupCommand(NULL, "one\\test.inf", "DefaultInstall", "", "Title", NULL, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL);
ok(hr == ERROR_SUCCESS || ok(hr == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", hr);
hr == E_FAIL, /* win9x */
"Expected ERROR_SUCCESS or E_FAIL, got %d\n", hr);
/* try only the INF filename, with working dir provided */ /* try only the INF filename, with working dir provided */
hr = pRunSetupCommand(NULL, "test.inf", "DefaultInstall", dir, "Title", NULL, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL); hr = pRunSetupCommand(NULL, "test.inf", "DefaultInstall", dir, "Title", NULL, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %d\n", hr);
hr == E_FAIL, /* win9x */
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) or E_FAIL, got %d\n", hr);
/* try only the INF filename, NULL working dir */ /* try only the INF filename, NULL working dir */
hr = pRunSetupCommand(NULL, "test.inf", "DefaultInstall", NULL, "Title", NULL, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL); hr = pRunSetupCommand(NULL, "test.inf", "DefaultInstall", NULL, "Title", NULL, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL);
@ -172,9 +164,7 @@ static void test_RunSetupCommand(void)
/* try only the INF filename, empty working dir */ /* try only the INF filename, empty working dir */
hr = pRunSetupCommand(NULL, "test.inf", "DefaultInstall", "", "Title", NULL, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL); hr = pRunSetupCommand(NULL, "test.inf", "DefaultInstall", "", "Title", NULL, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %d\n", hr);
hr == E_FAIL, /* win9x */
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) or E_FAIL, got %d\n", hr);
DeleteFileA("one\\test.inf"); DeleteFileA("one\\test.inf");
RemoveDirectoryA("one"); RemoveDirectoryA("one");
@ -183,9 +173,7 @@ static void test_RunSetupCommand(void)
/* try INF file in the current directory, working directory provided */ /* try INF file in the current directory, working directory provided */
hr = pRunSetupCommand(NULL, "test.inf", "DefaultInstall", CURR_DIR, "Title", NULL, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL); hr = pRunSetupCommand(NULL, "test.inf", "DefaultInstall", CURR_DIR, "Title", NULL, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %d\n", hr);
hr == E_FAIL, /* win9x */
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) or E_FAIL, got %d\n", hr);
/* try INF file in the current directory, NULL working directory */ /* try INF file in the current directory, NULL working directory */
hr = pRunSetupCommand(NULL, "test.inf", "DefaultInstall", NULL, "Title", NULL, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL); hr = pRunSetupCommand(NULL, "test.inf", "DefaultInstall", NULL, "Title", NULL, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL);
@ -194,9 +182,7 @@ static void test_RunSetupCommand(void)
/* try INF file in the current directory, empty working directory */ /* try INF file in the current directory, empty working directory */
hr = pRunSetupCommand(NULL, "test.inf", "DefaultInstall", CURR_DIR, "Title", NULL, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL); hr = pRunSetupCommand(NULL, "test.inf", "DefaultInstall", CURR_DIR, "Title", NULL, RSC_FLAG_INF | RSC_FLAG_QUIET, NULL);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %d\n", hr);
hr == E_FAIL, /* win9x */
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) or E_FAIL, got %d\n", hr);
} }
static void test_LaunchINFSection(void) static void test_LaunchINFSection(void)