Module: wine Branch: master Commit: dad9dc941fe1f9d7e6cbe370ef852e3fbb425c64 URL: http://source.winehq.org/git/wine.git/?a=commit;h=dad9dc941fe1f9d7e6cbe370ef...
Author: Vincent Povirk vincent@codeweavers.com Date: Wed Feb 5 16:33:39 2014 -0600
mscoree/tests: Fix failures when .NET 4 but not 1 or 2 is installed.
---
dlls/mscoree/tests/mscoree.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/dlls/mscoree/tests/mscoree.c b/dlls/mscoree/tests/mscoree.c index 19e8fdd..852944f 100644 --- a/dlls/mscoree/tests/mscoree.c +++ b/dlls/mscoree/tests/mscoree.c @@ -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");