[PATCH 3/4] msi/tests: Test deferral of RegisterFonts and UnregisterFonts.
Zebediah Figura
z.figura12 at gmail.com
Fri May 25 21:18:14 CDT 2018
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
dlls/msi/tests/action.c | 14 ++++++++++++++
dlls/msi/tests/custom.c | 32 ++++++++++++++++++++++++++++++++
dlls/msi/tests/custom.spec | 2 ++
3 files changed, 48 insertions(+)
diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c
index 43d76a3..91cf3e1 100644
--- a/dlls/msi/tests/action.c
+++ b/dlls/msi/tests/action.c
@@ -799,13 +799,26 @@ static const char font_install_exec_seq_dat[] =
"RemoveFiles\t\t3500\n"
"InstallFiles\t\t4000\n"
"RegisterFonts\t\t4100\n"
+ "rf_immediate\tNOT REMOVE\t4101\n"
+ "rf_deferred\tNOT REMOVE\t4102\n"
"UnregisterFonts\t\t4200\n"
+ "uf_immediate\tREMOVE\t4201\n"
+ "uf_deferred\tREMOVE\t4202\n"
"RegisterUser\t\t6000\n"
"RegisterProduct\t\t6100\n"
"PublishFeatures\t\t6300\n"
"PublishProduct\t\t6400\n"
"InstallFinalize\t\t6600";
+static const char font_custom_action_dat[] =
+ "Action\tType\tSource\tTarget\n"
+ "s72\ti2\tS64\tS0\n"
+ "CustomAction\tAction\n"
+ "rf_immediate\t1\tcustom.dll\tfont_absent\n"
+ "rf_deferred\t1025\tcustom.dll\tfont_present\n"
+ "uf_immediate\t1\tcustom.dll\tfont_present\n"
+ "uf_deferred\t1025\tcustom.dll\tfont_absent\n";
+
static const char vp_property_dat[] =
"Property\tValue\n"
"s72\tl0\n"
@@ -2054,6 +2067,7 @@ static const msi_table font_tables[] =
ADD_TABLE(font_file),
ADD_TABLE(font),
ADD_TABLE(font_install_exec_seq),
+ ADD_TABLE(font_custom_action),
ADD_TABLE(font_media),
ADD_TABLE(property)
};
diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c
index 566ab1a..306a8f3 100644
--- a/dlls/msi/tests/custom.c
+++ b/dlls/msi/tests/custom.c
@@ -1642,3 +1642,35 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
return ERROR_SUCCESS;
}
+
+static const char font_key[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
+
+UINT WINAPI font_present(MSIHANDLE hinst)
+{
+ HKEY key;
+ LONG res;
+
+ res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, font_key, 0, KEY_QUERY_VALUE | KEY_WOW64_64KEY, &key);
+ ok(hinst, !res, "got %u\n", res);
+ res = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL);
+todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
+ ok(hinst, !res, "got %u\n", res);
+ RegCloseKey(key);
+
+ return ERROR_SUCCESS;
+}
+
+UINT WINAPI font_absent(MSIHANDLE hinst)
+{
+ HKEY key;
+ LONG res;
+
+ res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, font_key, 0, KEY_QUERY_VALUE | KEY_WOW64_64KEY, &key);
+ ok(hinst, !res, "got %u\n", res);
+todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) {
+ check_reg_str(hinst, key, "msi test font", NULL);
+}
+ RegCloseKey(key);
+
+ return ERROR_SUCCESS;
+}
diff --git a/dlls/msi/tests/custom.spec b/dlls/msi/tests/custom.spec
index d302d05..b28b393 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 font_present(long)
+@ stdcall font_absent(long)
@ stdcall mov_present(long)
@ stdcall mov_absent(long)
@ stdcall odbc_present(long)
--
2.7.4
More information about the wine-devel
mailing list