Commit 69c6fff3 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

msi: Add another test for the SourceDir property.

parent ebf27335
...@@ -2893,6 +2893,82 @@ static void test_sourcedirprop(void) ...@@ -2893,6 +2893,82 @@ static void test_sourcedirprop(void)
DeleteFileA(msifile); DeleteFileA(msifile);
} }
static void test_prop_path(void)
{
MSIHANDLE hpkg, hdb;
char buffer[MAX_PATH], cwd[MAX_PATH];
DWORD sz;
UINT r;
GetCurrentDirectory(MAX_PATH, cwd);
strcat(cwd, "\\");
hdb = create_package_db();
ok( hdb, "failed to create database\n");
r = add_directory_entry( hdb, "'TARGETDIR','','SourceDir'" );
ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
r = add_directory_entry( hdb, "'foo','TARGETDIR','foosrc:footgt'" );
ok( r == ERROR_SUCCESS, "cannot add directory: %d\n", r );
hpkg = package_from_db(hdb);
ok( hpkg, "failed to create package\n");
r = MsiGetSourcePath(hpkg, "SourceDir", buffer, &sz );
ok( r == ERROR_DIRECTORY, "failed to get source path\n");
r = MsiGetSourcePath(hpkg, "SOURCEDIR", buffer, &sz );
ok( r == ERROR_DIRECTORY, "failed to get source path\n");
r = MsiDoAction( hpkg, "CostInitialize");
ok( r == ERROR_SUCCESS, "cost init failed\n");
sz = sizeof buffer;
buffer[0] = 0;
r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
ok( r == ERROR_SUCCESS, "property not set\n");
ok( !buffer[0], "SourceDir should be empty\n");
sz = sizeof buffer;
buffer[0] = 0;
r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
ok( r == ERROR_SUCCESS, "property not set\n");
ok( !buffer[0], "SourceDir should be empty\n");
sz = sizeof buffer;
buffer[0] = 0;
r = MsiGetSourcePath(hpkg, "SourceDir", buffer, &sz );
todo_wine {
ok( r == ERROR_SUCCESS, "failed to get source path\n");
ok( !lstrcmpi(cwd, buffer), "SourceDir (%s) should be current dir (%s)\n", buffer, cwd);
}
sz = sizeof buffer;
buffer[0] = 0;
r = MsiGetProperty(hpkg, "SourceDir", buffer, &sz);
ok( r == ERROR_SUCCESS, "property not set\n");
todo_wine {
ok( !lstrcmpi(cwd, buffer), "SourceDir (%s) should be current dir (%s)\n", buffer, cwd);
}
sz = sizeof buffer;
buffer[0] = 0;
r = MsiGetSourcePath(hpkg, "SOURCEDIR", buffer, &sz );
ok( r == ERROR_DIRECTORY, "failed to get source path\n");
sz = sizeof buffer;
buffer[0] = 0;
r = MsiGetProperty(hpkg, "SOURCEDIR", buffer, &sz);
ok( r == ERROR_SUCCESS, "property not set\n");
todo_wine {
ok( !lstrcmpi(cwd, buffer), "SourceDir (%s) should be current dir (%s)\n", buffer, cwd);
}
MsiCloseHandle( hpkg );
DeleteFile(msifile);
}
START_TEST(package) START_TEST(package)
{ {
test_createpackage(); test_createpackage();
...@@ -2913,4 +2989,5 @@ START_TEST(package) ...@@ -2913,4 +2989,5 @@ START_TEST(package)
test_featureparents(); test_featureparents();
test_installprops(); test_installprops();
test_sourcedirprop(); test_sourcedirprop();
test_prop_path();
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment