[PATCH v2 5/5] msi/tests: Add a test for asynchronous custom actions.
Zebediah Figura
z.figura12 at gmail.com
Thu Aug 16 10:34:41 CDT 2018
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
v2: improve tests to ensure that both actions run
dlls/msi/tests/custom.c | 21 +++++++++++++++++++++
dlls/msi/tests/custom.spec | 2 ++
dlls/msi/tests/install.c | 10 +++++++++-
3 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c
index 3989ca8..6332d68 100644
--- a/dlls/msi/tests/custom.c
+++ b/dlls/msi/tests/custom.c
@@ -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];
diff --git a/dlls/msi/tests/custom.spec b/dlls/msi/tests/custom.spec
index b7cbe58..5d78377 100644
--- a/dlls/msi/tests/custom.spec
+++ b/dlls/msi/tests/custom.spec
@@ -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)
diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index e147df6..4fa1862 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -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");
--
2.7.4
More information about the wine-devel
mailing list