msi: Add some tests for MsiGetTargetPathW.

This commit is contained in:
Hans Leidekker 2009-10-15 12:47:17 +02:00 committed by Alexandre Julliard
parent 843382f284
commit 55b89f4a66
1 changed files with 29 additions and 0 deletions

View File

@ -843,7 +843,10 @@ static void test_doaction( void )
static void test_gettargetpath_bad(void)
{
static const WCHAR boo[] = {'b','o','o',0};
static const WCHAR empty[] = {0};
char buffer[0x80];
WCHAR bufferW[0x80];
MSIHANDLE hpkg;
DWORD sz;
UINT r;
@ -869,6 +872,32 @@ static void test_gettargetpath_bad(void)
r = MsiGetTargetPath( hpkg, "boo", buffer, NULL );
ok( r == ERROR_DIRECTORY, "wrong return val\n");
sz = 0;
r = MsiGetTargetPath( hpkg, "", buffer, &sz );
ok( r == ERROR_DIRECTORY, "wrong return val\n");
r = MsiGetTargetPathW( 0, NULL, NULL, NULL );
ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
r = MsiGetTargetPathW( 0, NULL, NULL, &sz );
ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
r = MsiGetTargetPathW( 0, boo, NULL, NULL );
ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
r = MsiGetTargetPathW( 0, boo, NULL, NULL );
ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
r = MsiGetTargetPathW( hpkg, boo, NULL, NULL );
ok( r == ERROR_DIRECTORY, "wrong return val\n");
r = MsiGetTargetPathW( hpkg, boo, bufferW, NULL );
ok( r == ERROR_DIRECTORY, "wrong return val\n");
sz = 0;
r = MsiGetTargetPathW( hpkg, empty, bufferW, &sz );
ok( r == ERROR_DIRECTORY, "wrong return val\n");
MsiCloseHandle( hpkg );
DeleteFile(msifile);
}