msi/tests: Add some more tests for MsiViewModify() applied to joins.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-01-29 23:57:00 -06:00 committed by Alexandre Julliard
parent 02e2659a4e
commit b9faa8d170
1 changed files with 45 additions and 10 deletions

View File

@ -3620,28 +3620,63 @@ static void test_join(void)
ok( r == ERROR_SUCCESS, "failed to fetch view: %d\n", r ); ok( r == ERROR_SUCCESS, "failed to fetch view: %d\n", r );
check_record(hrec, 2, "alveolar", "procerus"); check_record(hrec, 2, "alveolar", "procerus");
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_REFRESH, hrec);
ok( r == ERROR_SUCCESS, "failed to refresh row: %d\n", r );
check_record(hrec, 2, "alveolar", "procerus");
r = MsiRecordSetStringA( hrec, 1, "epicranius" ); r = MsiRecordSetStringA( hrec, 1, "epicranius" );
ok( r == ERROR_SUCCESS, "failed to set string: %d\n", r ); ok( r == ERROR_SUCCESS, "failed to set string: %d\n", r );
r = MsiViewModify(hview, MSIMODIFY_UPDATE, hrec); r = MsiViewModify(hview, MSIMODIFY_UPDATE, hrec);
ok( r == ERROR_SUCCESS, "failed to update row: %d\n", r ); ok( r == ERROR_SUCCESS, "failed to update row: %d\n", r );
/* try another valid operation for joins */ /* primary key cannot be updated */
r = MsiViewModify(hview, MSIMODIFY_REFRESH, hrec);
ok( r == ERROR_SUCCESS, "failed to refresh row: %d\n", r );
check_record(hrec, 2, "epicranius", "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, 2, "epicranius" ); r = MsiRecordSetStringA( hrec, 2, "epicranius" );
ok( r == ERROR_SUCCESS, "failed to set string: %d\n", r ); ok( r == ERROR_SUCCESS, "failed to set string: %d\n", r );
/* primary key cannot be updated */
r = MsiViewModify(hview, MSIMODIFY_UPDATE, hrec); r = MsiViewModify(hview, MSIMODIFY_UPDATE, hrec);
ok( r == ERROR_FUNCTION_FAILED, "failed to update row: %d\n", r ); 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); MsiCloseHandle(hrec);
MsiViewClose(hview); MsiViewClose(hview);
MsiCloseHandle(hview); MsiCloseHandle(hview);