https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3b4aa9822bbc9b3befa48…
commit 3b4aa9822bbc9b3befa48cd46ec7d9b51311c1bf
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sun Mar 13 00:16:40 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 20 19:28:12 2022 +0100
[WINESYNC] msi/tests: Add some more tests for MsiViewModify() applied to joins.
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 b9faa8d170349ce48e7f572461e7c41422317e43 by Zebediah Figura
<z.figura12(a)gmail.com>
---
modules/rostests/winetests/msi/db.c | 55 ++++++++++++++++++++++++++++++-------
1 file changed, 45 insertions(+), 10 deletions(-)
diff --git a/modules/rostests/winetests/msi/db.c b/modules/rostests/winetests/msi/db.c
index e8ae8d21d3c..bcde840bd83 100644
--- a/modules/rostests/winetests/msi/db.c
+++ b/modules/rostests/winetests/msi/db.c
@@ -3620,28 +3620,63 @@ static void test_join(void)
ok( r == ERROR_SUCCESS, "failed to fetch view: %d\n", r );
check_record(hrec, 2, "alveolar", "procerus");
- r = MsiRecordSetStringA( hrec, 1, "epicranius" );
+ r = MsiRecordSetStringA( hrec, 1, "fascia" );
+ ok( r == ERROR_SUCCESS, "failed to set string: %d\n", r );
+ r = MsiRecordSetStringA( hrec, 2, "pterygoid" );
ok( r == ERROR_SUCCESS, "failed to set string: %d\n", r );
- r = MsiViewModify(hview, MSIMODIFY_UPDATE, hrec);
- ok( r == ERROR_SUCCESS, "failed to update row: %d\n", r );
-
- /* try another valid operation for joins */
r = MsiViewModify(hview, MSIMODIFY_REFRESH, hrec);
ok( r == ERROR_SUCCESS, "failed to refresh row: %d\n", r );
- check_record(hrec, 2, "epicranius", "procerus");
+ check_record(hrec, 2, "alveolar", "procerus");
- /* try an invalid operation for joins */
- r = MsiViewModify(hview, MSIMODIFY_DELETE, hrec);
- ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r );
+ r = MsiRecordSetStringA( hrec, 1, "epicranius" );
+ ok( r == ERROR_SUCCESS, "failed to set string: %d\n", r );
+ r = MsiViewModify(hview, MSIMODIFY_UPDATE, hrec);
+ ok( r == ERROR_SUCCESS, "failed to update row: %d\n", r );
+
+ /* primary key cannot be updated */
r = MsiRecordSetStringA( hrec, 2, "epicranius" );
ok( r == ERROR_SUCCESS, "failed to set string: %d\n", r );
- /* primary key cannot be updated */
r = MsiViewModify(hview, MSIMODIFY_UPDATE, hrec);
ok( r == ERROR_FUNCTION_FAILED, "failed to update row: %d\n", r );
+ /* all other operations are invalid for joins */
+ r = MsiViewModify(hview, MSIMODIFY_SEEK, hrec);
+ ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r );
+
+ r = MsiViewModify(hview, MSIMODIFY_ASSIGN, hrec);
+ ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r );
+
+ r = MsiViewModify(hview, MSIMODIFY_REPLACE, hrec);
+ ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r );
+
+ r = MsiViewModify(hview, MSIMODIFY_MERGE, hrec);
+ ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r );
+
+ r = MsiViewModify(hview, MSIMODIFY_DELETE, hrec);
+ ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r );
+
+ r = MsiViewModify(hview, MSIMODIFY_VALIDATE, hrec);
+ ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r );
+
+ r = MsiViewModify(hview, MSIMODIFY_VALIDATE_DELETE, hrec);
+ ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r );
+
+ MsiRecordSetStringA(hrec, 2, "epicranius");
+ r = MsiViewModify(hview, MSIMODIFY_INSERT, hrec);
+ ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r );
+
+ r = MsiViewModify(hview, MSIMODIFY_INSERT_TEMPORARY, hrec);
+ ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r );
+
+ r = MsiViewModify(hview, MSIMODIFY_VALIDATE_NEW, hrec);
+ ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r );
+
+ r = MsiViewModify(hview, MSIMODIFY_VALIDATE_FIELD, hrec);
+ ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r );
+
MsiCloseHandle(hrec);
MsiViewClose(hview);
MsiCloseHandle(hview);