[MSI_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924

svn path=/trunk/; revision=68462
This commit is contained in:
Amine Khaldi 2015-07-19 23:04:56 +00:00
parent 3acd6eee67
commit e70d9ba6d5
4 changed files with 62 additions and 7 deletions

View file

@ -2771,7 +2771,7 @@ static void test_markers(void)
DeleteFileA(msifile);
}
#define MY_NVIEWS 4000 /* Largest installer I've seen uses < 2k */
#define MY_NVIEWS 4000 /* Largest installer I've seen uses < 2000 */
static void test_handle_limit(void)
{
int i;
@ -3190,7 +3190,8 @@ static void test_try_transform(void)
r = MsiDatabaseApplyTransformA( hdb, mstfile, 0 );
ok( r == ERROR_SUCCESS, "return code %d, should be ERROR_SUCCESS\n", r );
MsiDatabaseCommit( hdb );
r = MsiDatabaseCommit( hdb );
ok( r == ERROR_SUCCESS , "Failed to commit database\n" );
/* check new values */
hrec = 0;

View file

@ -2930,6 +2930,7 @@ static void test_continuouscabs(void)
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
{
skip("Not enough rights to perform tests\n");
goto error;
}
else
{
@ -3012,6 +3013,7 @@ static void test_continuouscabs(void)
ok(delete_pf("msitest", FALSE), "Directory not created\n");
}
error:
delete_cab_files();
DeleteFileA(msifile);
}
@ -3155,7 +3157,7 @@ static void test_samesequence(void)
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS || broken(r == ERROR_INSTALL_FAILURE), "Expected ERROR_SUCCESS, got %u\n", r);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
if (r == ERROR_SUCCESS)
{
ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
@ -3177,7 +3179,7 @@ static void test_uiLevelFlags(void)
MsiSetInternalUI(INSTALLUILEVEL_NONE | INSTALLUILEVEL_SOURCERESONLY, NULL);
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS || broken(r == ERROR_INSTALL_FAILURE), "Expected ERROR_SUCCESS, got %u\n", r);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
if (r == ERROR_SUCCESS)
{
ok(!delete_pf("msitest\\maximus", TRUE), "UI install occurred, but execute-only was requested.\n");
@ -4510,6 +4512,11 @@ static void test_missingcomponent(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
ok(pf_exists("msitest\\helium"), "File not installed\n");
@ -5078,7 +5085,7 @@ static void process_pending_renames(HKEY hkey)
else
{
fileret = DeleteFileA(src);
ok(fileret, "Failed to delete file %s (%u)\n", src, GetLastError());
ok(fileret || broken(!fileret) /* win2k3 */, "Failed to delete file %s (%u)\n", src, GetLastError());
}
}
@ -5888,7 +5895,8 @@ START_TEST(install)
lstrcatA(log_file, "\\msitest.log");
MsiEnableLogA(INSTALLLOGMODE_FATALEXIT, log_file, 0);
test_MsiInstallProduct();
if (pSRSetRestorePointA) /* test has side-effects on win2k3 that cause failures in following tests */
test_MsiInstallProduct();
test_MsiSetComponentState();
test_packagecoltypes();
test_continuouscabs();

View file

@ -968,6 +968,29 @@ static UINT find_entry( MSIHANDLE hdb, const char *table, const char *entry )
return r;
}
static UINT find_entryW( MSIHANDLE hdb, const WCHAR *table, const WCHAR *entry )
{
static const WCHAR fmt[] =
{'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','%','s','`',' ',
'W','H','E','R','E',' ','`','N','a','m','e','`',' ','=',' ','\'','%','s','\'',0};
WCHAR query[0x100];
MSIHANDLE hview, hrec;
UINT r;
wsprintfW( query, fmt, table, entry );
r = MsiDatabaseOpenViewW( hdb, query, &hview );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
r = MsiViewExecute( hview, 0 );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
r = MsiViewFetch( hview, &hrec );
MsiViewClose( hview );
MsiCloseHandle( hview );
MsiCloseHandle( hrec );
return r;
}
static INT get_integer( MSIHANDLE hdb, UINT field, const char *query)
{
UINT r;
@ -1031,11 +1054,13 @@ static char *get_string( MSIHANDLE hdb, UINT field, const char *query)
static void test_system_tables( void )
{
static const char patchsource[] = "MSPSRC0F96CDC04CDF4304B2837B9264889EF7";
static const WCHAR streamsW[] = {'_','S','t','r','e','a','m','s',0};
static const WCHAR CAB_msitest_encodedW[] = {0x3a8c,0x47cb,0x45b0,0x45ec,0x45a8,0x4837,0};
UINT r;
char *cr;
const char *query;
MSIHANDLE hproduct, hdb, hview, hrec;
static const char patchsource[] = "MSPSRC0F96CDC04CDF4304B2837B9264889EF7";
if (!pMsiApplyPatchA)
{
@ -1137,6 +1162,9 @@ static void test_system_tables( void )
r = find_entry( hdb, "_Streams", "\5SummaryInformation" );
ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
r = find_entryW( hdb, streamsW, CAB_msitest_encodedW );
ok( r == ERROR_NO_MORE_ITEMS, "failed to find entry %u\n", r );
query = "SELECT * FROM `_Storages`";
r = MsiDatabaseOpenViewA( hdb, query, &hview );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );

View file

@ -2887,6 +2887,24 @@ static void test_MsiSourceListEnumMediaDisks(void)
ok(labelsz == MAX_PATH, "Expected MAX_PATH, got %d\n", labelsz);
ok(!lstrcmpA(prompt, "bbb"), "Expected \"bbb\", got \"%s\"\n", prompt);
/* pcchVolumeLabel, szDiskPrompt and pcchDiskPrompt are NULL */
id = 0;
lstrcpyA(label, "aaa");
r = pMsiSourceListEnumMediaDisksA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, 0, &id, label, NULL,
NULL, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(label, "aaa"), "Expected \"aaa\", got \"%s\"\n", label);
ok(id == 1, "Expected 1, got %d\n", id);
/* szVolumeLabel, pcchVolumeLabel, szDiskPrompt and pcchDiskPrompt are NULL */
id = 0;
r = pMsiSourceListEnumMediaDisksA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, 0, &id, NULL, NULL,
NULL, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(id == 1, "Expected 1, got %d\n", id);
/* pcchVolumeLabel is exactly 5 */
lstrcpyA(label, "aaa");
labelsz = 5;