Commit 3272fef9 authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

msi/tests: Only use functions if they are implemented.

parent c2a7914d
...@@ -48,14 +48,21 @@ static void init_functionpointers(void) ...@@ -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"); GET_PROC(hmsi, MsiGetComponentPathA)
GET_PROC(hmsi, MsiGetFileHashA)
pConvertSidToStringSidA = (void*)GetProcAddress(hadvapi32, "ConvertSidToStringSidA"); 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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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();
}
} }
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