mscoree/tests: Fix failures when .NET 4 but not 1 or 2 is installed.

This commit is contained in:
Vincent Povirk 2014-02-05 16:33:39 -06:00 committed by Alexandre Julliard
parent ed1a03e494
commit dad9dc941f
1 changed files with 16 additions and 3 deletions

View File

@ -34,6 +34,8 @@ static HRESULT (WINAPI *pLoadLibraryShim)(LPCWSTR, LPCWSTR, LPVOID, HMODULE*);
static HRESULT (WINAPI *pCreateConfigStream)(LPCWSTR, IStream**);
static HRESULT (WINAPI *pCreateInterface)(REFCLSID, REFIID, VOID**);
static int no_legacy_runtimes;
static BOOL init_functionpointers(void)
{
hmscoree = LoadLibraryA("mscoree.dll");
@ -85,9 +87,8 @@ static void test_versioninfo(void)
hr = pGetCORVersion(version, 1, &size);
if (hr == CLR_E_SHIM_RUNTIME)
{
/* FIXME: Get Mono packaged properly so we can fail here. */
todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER),"GetCORVersion returned %08x\n", hr);
skip("No .NET runtimes are installed\n");
no_legacy_runtimes = 1;
win_skip("No legacy .NET runtimes are installed\n");
return;
}
@ -208,6 +209,12 @@ static void test_loadlibraryshim(void)
HMODULE hdll;
CHAR dllpath[MAX_PATH];
if (no_legacy_runtimes)
{
win_skip("No legacy .NET runtimes are installed\n");
return;
}
hr = pLoadLibraryShim(fusion, v1_1, NULL, &hdll);
ok(hr == S_OK || hr == E_HANDLE, "LoadLibraryShim failed, hr=%x\n", hr);
if (SUCCEEDED(hr))
@ -395,6 +402,12 @@ static void test_createinstance(void)
HRESULT hr;
ICLRMetaHost *host;
if (no_legacy_runtimes)
{
/* If we don't have 1.x or 2.0 runtimes, we should at least have .NET 4. */
ok(pCreateInterface != NULL, "no legacy runtimes or .NET 4 interfaces available\n");
}
if(!pCreateInterface)
{
win_skip("Function CreateInterface not found.\n");