Zebediah Figura : msi/tests: Add more tests for deferred custom actions.

Alexandre Julliard julliard at winehq.org
Wed Feb 21 18:39:41 CST 2018


Module: wine
Branch: master
Commit: b44ac90ae7ee44f9f5d9cba509710be28faea629
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=b44ac90ae7ee44f9f5d9cba509710be28faea629

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Tue Feb 20 09:03:20 2018 -0600

msi/tests: Add more tests for deferred custom actions.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msi/tests/custom.c | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c
index f504464..feb8061 100644
--- a/dlls/msi/tests/custom.c
+++ b/dlls/msi/tests/custom.c
@@ -104,6 +104,10 @@ UINT WINAPI da_immediate(MSIHANDLE hinst)
 
     append_file(hinst, prop, "one");
 
+    ok(hinst, !MsiGetMode(hinst, MSIRUNMODE_SCHEDULED), "shouldn't be scheduled\n");
+    ok(hinst, !MsiGetMode(hinst, MSIRUNMODE_ROLLBACK), "shouldn't be rollback\n");
+    ok(hinst, !MsiGetMode(hinst, MSIRUNMODE_COMMIT), "shouldn't be commit\n");
+
     return ERROR_SUCCESS;
 }
 
@@ -111,10 +115,39 @@ UINT WINAPI da_deferred(MSIHANDLE hinst)
 {
     char prop[300];
     DWORD len = sizeof(prop);
+    LANGID lang;
+    UINT r;
 
-    MsiGetPropertyA(hinst, "CustomActionData", prop, &len);
+    /* Test that we were in fact deferred */
+    r = MsiGetPropertyA(hinst, "CustomActionData", prop, &len);
+    ok(hinst, r == ERROR_SUCCESS, "got %u\n", r);
+    ok(hinst, prop[0], "CustomActionData was empty\n");
 
     append_file(hinst, prop, "two");
 
+    /* Test available properties */
+    len = sizeof(prop);
+    r = MsiGetPropertyA(hinst, "ProductCode", prop, &len);
+    ok(hinst, r == ERROR_SUCCESS, "got %u\n", r);
+    ok(hinst, prop[0], "got %s\n", prop);
+
+    len = sizeof(prop);
+    r = MsiGetPropertyA(hinst, "UserSID", prop, &len);
+    ok(hinst, r == ERROR_SUCCESS, "got %u\n", r);
+    ok(hinst, prop[0], "got %s\n", prop);
+
+    len = sizeof(prop);
+    r = MsiGetPropertyA(hinst, "TESTPATH", prop, &len);
+    ok(hinst, r == ERROR_SUCCESS, "got %u\n", r);
+    todo_wine_ok(hinst, !prop[0], "got %s\n", prop);
+
+    /* Test modes */
+    ok(hinst, MsiGetMode(hinst, MSIRUNMODE_SCHEDULED), "should be scheduled\n");
+    ok(hinst, !MsiGetMode(hinst, MSIRUNMODE_ROLLBACK), "shouldn't be rollback\n");
+    ok(hinst, !MsiGetMode(hinst, MSIRUNMODE_COMMIT), "shouldn't be commit\n");
+
+    lang = MsiGetLanguage(hinst);
+    ok(hinst, lang != ERROR_INVALID_HANDLE, "MsiGetLanguage failed\n");
+
     return ERROR_SUCCESS;
 }




More information about the wine-cvs mailing list