msi/tests: Add a test for asynchronous custom actions.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2018-08-16 10:34:41 -05:00 committed by Alexandre Julliard
parent 2592690540
commit 6387476d99
3 changed files with 32 additions and 1 deletions

View File

@ -1169,6 +1169,27 @@ UINT WINAPI process2(MSIHANDLE hinst)
return ERROR_SUCCESS;
}
UINT WINAPI async1(MSIHANDLE hinst)
{
HANDLE event = CreateEventA(NULL, TRUE, FALSE, "wine_msi_async_test");
HANDLE event2 = CreateEventA(NULL, TRUE, FALSE, "wine_msi_async_test2");
DWORD r = WaitForSingleObject(event, 10000);
ok(hinst, !r, "wait timed out\n");
SetEvent(event2);
return ERROR_SUCCESS;
}
UINT WINAPI async2(MSIHANDLE hinst)
{
HANDLE event = CreateEventA(NULL, TRUE, FALSE, "wine_msi_async_test");
HANDLE event2 = CreateEventA(NULL, TRUE, FALSE, "wine_msi_async_test2");
DWORD r;
SetEvent(event);
r = WaitForSingleObject(event2, 10000);
ok(hinst, !r, "wait timed out\n");
return ERROR_SUCCESS;
}
static BOOL pf_exists(const char *file)
{
char path[MAX_PATH];

View File

@ -5,6 +5,8 @@
@ stdcall nested(long)
@ stdcall process1(long)
@ stdcall process2(long)
@ stdcall async1(long)
@ stdcall async2(long)
@ stdcall cf_present(long)
@ stdcall cf_absent(long)

View File

@ -677,6 +677,8 @@ static const CHAR ca1_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
"process1\tTEST_PROCESS\t720\n"
"process2\tTEST_PROCESS\t721\n"
"process_deferred\tTEST_PROCESS\t722\n"
"async1\tTEST_ASYNC\t730\n"
"async2\tTEST_ASYNC\t731\n"
"InstallFinalize\t\t800\n";
static const CHAR ca1_custom_action_dat[] = "Action\tType\tSource\tTarget\n"
@ -689,6 +691,8 @@ static const CHAR ca1_custom_action_dat[] = "Action\tType\tSource\tTarget\n"
"process1\t1\tcustom.dll\tprocess1\n"
"process2\t1\tcustom.dll\tprocess2\n"
"process_deferred\t1025\tcustom.dll\tprocess2\n"
"async1\t129\tcustom.dll\tasync1\n"
"async2\t1\tcustom.dll\tasync2\n"
"testretval\t1\tcustom.dll\ttest_retval\n";
static const CHAR ca1_test_seq_dat[] = "Action\tCondition\tSequence\n"
@ -4129,7 +4133,7 @@ static void test_customaction1(void)
r = MsiInstallProductA(msifile, "TEST_RETVAL=0");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
r = MsiInstallProductA(msifile, "TEST_RETVAL=1626"); /* ERROR_FUNCTION_NOT_CALLED*/
r = MsiInstallProductA(msifile, "TEST_RETVAL=1626"); /* ERROR_FUNCTION_NOT_CALLED */
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
r = MsiInstallProductA(msifile, "TEST_RETVAL=1602");
@ -4146,6 +4150,10 @@ static void test_customaction1(void)
r = MsiInstallProductA(msifile, "TEST_PROCESS=1");
ok(!r, "got %u\n", r);
/* test asynchronous actions (msidbCustomActionTypeAsync) */
r = MsiInstallProductA(msifile, "TEST_ASYNC=1");
ok(!r, "got %u\n", r);
delete_test_files();
DeleteFileA(msifile);
DeleteFileA("unus");