https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f7e42b9b96b950be925d9…
commit f7e42b9b96b950be925d95d2ff9c88dae775e4d2
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sun Mar 13 01:19:31 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 20 19:28:16 2022 +0100
[WINESYNC] msi/tests: Test calling more functions from custom actions.
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id ae0298d46e8d4b7b689783b9c459ceafc3631780 by Zebediah Figura
<z.figura12(a)gmail.com>
---
modules/rostests/winetests/msi/custom.c | 54 +++++++++++++++++++++++++++++----
1 file changed, 48 insertions(+), 6 deletions(-)
diff --git a/modules/rostests/winetests/msi/custom.c
b/modules/rostests/winetests/msi/custom.c
index c7ce4d20aeb..6ae5bfc30a9 100644
--- a/modules/rostests/winetests/msi/custom.c
+++ b/modules/rostests/winetests/msi/custom.c
@@ -1112,11 +1112,57 @@ static void test_costs(MSIHANDLE hinst)
ok(hinst, sz == 2, "got size %u\n", sz);
}
+static void test_invalid_functions(MSIHANDLE hinst)
+{
+ char path[MAX_PATH], package_name[20];
+ MSIHANDLE db, preview, package;
+ UINT r;
+
+ r = MsiGetDatabaseState(hinst);
+ todo_wine ok(hinst, r == MSIDBSTATE_ERROR, "got %u\n", r);
+
+ db = MsiGetActiveDatabase(hinst);
+ ok(hinst, db, "MsiGetActiveDatabase failed\n");
+
+ r = MsiDatabaseGenerateTransformA(db, db, "bogus.mst", 0, 0);
+ todo_wine ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
+
+ r = MsiDatabaseApplyTransformA(db, "bogus.mst", 0);
+ todo_wine ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
+
+ r = MsiCreateTransformSummaryInfoA(db, db, "bogus.mst", 0, 0);
+ todo_wine ok(hinst, r == ERROR_INSTALL_PACKAGE_OPEN_FAILED, "got %u\n",
r);
+
+ GetCurrentDirectoryA(sizeof(path), path);
+ r = MsiDatabaseExportA(db, "Test", path, "bogus.idt");
+ todo_wine ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
+
+ r = MsiDatabaseImportA(db, path, "bogus.idt");
+ todo_wine ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
+
+ r = MsiDatabaseCommit(db);
+ ok(hinst, r == ERROR_SUCCESS, "got %u\n", r);
+
+ r = MsiDatabaseMergeA(db, db, "MergeErrors");
+ ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
+
+ r = MsiGetDatabaseState(db);
+ todo_wine ok(hinst, r == MSIDBSTATE_ERROR, "got %u\n", r);
+
+ r = MsiEnableUIPreview(db, &preview);
+ todo_wine ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
+
+ sprintf(package_name, "#%u", db);
+ r = MsiOpenPackageA(package_name, &package);
+ todo_wine ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
+
+ MsiCloseHandle(db);
+}
+
/* Main test. Anything that doesn't depend on a specific install configuration
* or have undesired side effects should go here. */
UINT WINAPI main_test(MSIHANDLE hinst)
{
- UINT res;
IUnknown *unk = NULL;
HRESULT hr;
@@ -1131,11 +1177,6 @@ UINT WINAPI main_test(MSIHANDLE hinst)
ok(hinst, hr == S_OK, "got %#x\n", hr);
CoUninitialize();
- /* Test MsiGetDatabaseState() */
- res = MsiGetDatabaseState(hinst);
- todo_wine
- ok(hinst, res == MSIDBSTATE_ERROR, "expected MSIDBSTATE_ERROR, got %u\n",
res);
-
test_props(hinst);
test_db(hinst);
test_doaction(hinst);
@@ -1144,6 +1185,7 @@ UINT WINAPI main_test(MSIHANDLE hinst)
test_feature_states(hinst);
test_format_record(hinst);
test_costs(hinst);
+ test_invalid_functions(hinst);
return ERROR_SUCCESS;
}