msi/tests: Only use functions if they are implemented.
This commit is contained in:
parent
c2a7914d1c
commit
3272fef91a
|
@ -48,14 +48,21 @@ static void init_functionpointers(void)
|
||||||
HMODULE hmsi = GetModuleHandleA("msi.dll");
|
HMODULE hmsi = GetModuleHandleA("msi.dll");
|
||||||
HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
|
HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
|
||||||
|
|
||||||
pMsiGetComponentPathA = (void*)GetProcAddress(hmsi, "MsiGetComponentPathA");
|
#define GET_PROC(dll, func) \
|
||||||
pMsiGetFileHashA = (void*)GetProcAddress(hmsi, "MsiGetFileHashA");
|
p ## func = (void *)GetProcAddress(dll, #func); \
|
||||||
pMsiOpenPackageExA = (void*)GetProcAddress(hmsi, "MsiOpenPackageExA");
|
if(!p ## func) \
|
||||||
pMsiOpenPackageExW = (void*)GetProcAddress(hmsi, "MsiOpenPackageExW");
|
trace("GetProcAddress(%s) failed\n", #func);
|
||||||
pMsiQueryComponentStateA = (void*)GetProcAddress(hmsi, "MsiQueryComponentStateA");
|
|
||||||
pMsiUseFeatureExA = (void*)GetProcAddress(hmsi, "MsiUseFeatureExA");
|
|
||||||
|
|
||||||
pConvertSidToStringSidA = (void*)GetProcAddress(hadvapi32, "ConvertSidToStringSidA");
|
GET_PROC(hmsi, MsiGetComponentPathA)
|
||||||
|
GET_PROC(hmsi, MsiGetFileHashA)
|
||||||
|
GET_PROC(hmsi, MsiOpenPackageExA)
|
||||||
|
GET_PROC(hmsi, MsiOpenPackageExW)
|
||||||
|
GET_PROC(hmsi, MsiQueryComponentStateA)
|
||||||
|
GET_PROC(hmsi, MsiUseFeatureExA)
|
||||||
|
|
||||||
|
GET_PROC(hadvapi32, ConvertSidToStringSidA)
|
||||||
|
|
||||||
|
#undef GET_PROC
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_usefeature(void)
|
static void test_usefeature(void)
|
||||||
|
@ -63,7 +70,10 @@ static void test_usefeature(void)
|
||||||
INSTALLSTATE r;
|
INSTALLSTATE r;
|
||||||
|
|
||||||
if (!pMsiUseFeatureExA)
|
if (!pMsiUseFeatureExA)
|
||||||
|
{
|
||||||
|
skip("MsiUseFeatureExA not implemented\n");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
r = MsiQueryFeatureState(NULL,NULL);
|
r = MsiQueryFeatureState(NULL,NULL);
|
||||||
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
|
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
|
||||||
|
@ -279,7 +289,7 @@ static void test_MsiGetFileHash(void)
|
||||||
|
|
||||||
if (!pMsiGetFileHashA)
|
if (!pMsiGetFileHashA)
|
||||||
{
|
{
|
||||||
skip("MsiGetFileHash not implemented.");
|
skip("MsiGetFileHash not implemented\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -724,6 +734,12 @@ static void test_MsiQueryComponentState(void)
|
||||||
|
|
||||||
static const INSTALLSTATE MAGIC_ERROR = 0xdeadbeef;
|
static const INSTALLSTATE MAGIC_ERROR = 0xdeadbeef;
|
||||||
|
|
||||||
|
if (!pMsiQueryComponentStateA)
|
||||||
|
{
|
||||||
|
skip("MsiQueryComponentStateA not implemented\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
create_test_guid(prodcode, prod_squashed);
|
create_test_guid(prodcode, prod_squashed);
|
||||||
compose_base85_guid(component, comp_base85, comp_squashed);
|
compose_base85_guid(component, comp_base85, comp_squashed);
|
||||||
get_user_sid(&usersid);
|
get_user_sid(&usersid);
|
||||||
|
@ -1782,10 +1798,17 @@ START_TEST(msi)
|
||||||
test_null();
|
test_null();
|
||||||
test_getcomponentpath();
|
test_getcomponentpath();
|
||||||
test_MsiGetFileHash();
|
test_MsiGetFileHash();
|
||||||
test_MsiQueryProductState();
|
|
||||||
test_MsiQueryFeatureState();
|
if (!pConvertSidToStringSidA)
|
||||||
test_MsiQueryComponentState();
|
skip("ConvertSidToStringSidA not implemented\n");
|
||||||
test_MsiGetComponentPath();
|
else
|
||||||
test_MsiGetProductCode();
|
{
|
||||||
test_MsiEnumClients();
|
/* These tests rely on get_user_sid that needs ConvertSidToStringSidA */
|
||||||
|
test_MsiQueryProductState();
|
||||||
|
test_MsiQueryFeatureState();
|
||||||
|
test_MsiQueryComponentState();
|
||||||
|
test_MsiGetComponentPath();
|
||||||
|
test_MsiGetProductCode();
|
||||||
|
test_MsiEnumClients();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue