From 55b89f4a66810518b88584a2130071529123c7ee Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Thu, 15 Oct 2009 12:47:17 +0200 Subject: [PATCH] msi: Add some tests for MsiGetTargetPathW. --- dlls/msi/tests/package.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index 55d9bb35b8f..fcad0be70ec 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -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); }