[PATCH 1/5] msi/tests: Test deferral of MoveFiles.

Zebediah Figura z.figura12 at gmail.com
Tue May 22 18:39:24 CDT 2018


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/msi/tests/action.c    | 26 +++++++++++++++++++++++++-
 dlls/msi/tests/custom.c    | 16 ++++++++++++++++
 dlls/msi/tests/custom.spec |  2 ++
 3 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c
index 943c939..1600fe3 100644
--- a/dlls/msi/tests/action.c
+++ b/dlls/msi/tests/action.c
@@ -526,6 +526,29 @@ static const char mov_move_file_dat[] =
     "wildcardnodest\taugustus\tbudd*\t\tSourceDir\tMSITESTDIR\t1\n"
     "singlenodest\taugustus\tb?r\t\tSourceDir\tMSITESTDIR\t1\n";
 
+static const char mov_install_exec_seq_dat[] =
+    "Action\tCondition\tSequence\n"
+    "s72\tS255\tI2\n"
+    "InstallExecuteSequence\tAction\n"
+    "CostInitialize\t\t100\n"
+    "FileCost\t\t200\n"
+    "ResolveSource\t\t300\n"
+    "CostFinalize\t\t400\n"
+    "InstallValidate\t\t500\n"
+    "InstallInitialize\t\t600\n"
+    "MoveFiles\t\t700\n"
+    "mov_immediate\t\t701\n"
+    "mov_deferred\t\t702\n"
+    "InstallFiles\t\t800\n"
+    "InstallFinalize\t\t900\n";
+
+static const char mov_custom_action_dat[] =
+    "Action\tType\tSource\tTarget\n"
+    "s72\ti2\tS64\tS0\n"
+    "CustomAction\tAction\n"
+    "mov_immediate\t1\tcustom.dll\tmov_absent\n"
+    "mov_deferred\t1025\tcustom.dll\tmov_present\n";
+
 static const char df_directory_dat[] =
     "Directory\tDirectory_Parent\tDefaultDir\n"
     "s72\tS72\tl255\n"
@@ -1843,7 +1866,8 @@ static const msi_table mov_tables[] =
     ADD_TABLE(rof_feature),
     ADD_TABLE(ci2_feature_comp),
     ADD_TABLE(ci2_file),
-    ADD_TABLE(install_exec_seq),
+    ADD_TABLE(mov_install_exec_seq),
+    ADD_TABLE(mov_custom_action),
     ADD_TABLE(rof_media),
     ADD_TABLE(property),
     ADD_TABLE(mov_move_file),
diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c
index 0f34eb0..0bf62d9 100644
--- a/dlls/msi/tests/custom.c
+++ b/dlls/msi/tests/custom.c
@@ -1363,3 +1363,19 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
 }
     return ERROR_SUCCESS;
 }
+
+UINT WINAPI mov_present(MSIHANDLE hinst)
+{
+    ok(hinst, pf_exists("msitest\\canada"), "file absent\n");
+    ok(hinst, pf_exists("msitest\\dominica"), "file absent\n");
+    return ERROR_SUCCESS;
+}
+
+UINT WINAPI mov_absent(MSIHANDLE hinst)
+{
+todo_wine {
+    ok(hinst, !pf_exists("msitest\\canada"), "file present\n");
+    ok(hinst, !pf_exists("msitest\\dominica"), "file present\n");
+}
+    return ERROR_SUCCESS;
+}
diff --git a/dlls/msi/tests/custom.spec b/dlls/msi/tests/custom.spec
index 52feffa..4b46dc3 100644
--- a/dlls/msi/tests/custom.spec
+++ b/dlls/msi/tests/custom.spec
@@ -9,6 +9,8 @@
 @ stdcall crs_absent(long)
 @ stdcall file_present(long)
 @ stdcall file_absent(long)
+@ stdcall mov_present(long)
+@ stdcall mov_absent(long)
 @ stdcall odbc_present(long)
 @ stdcall odbc_absent(long)
 @ stdcall rd_present(long)
-- 
2.7.4




More information about the wine-devel mailing list