Louis Lenders : mscoree/tests: Add a few tests for GetCORSytemDirectory.

Alexandre Julliard julliard at winehq.org
Wed Aug 25 12:35:07 CDT 2010


Module: wine
Branch: master
Commit: f317d6b32d1f6e3a68879b139aa9a3bdbc3d8a55
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f317d6b32d1f6e3a68879b139aa9a3bdbc3d8a55

Author: Louis Lenders <xerox_xerox2000 at yahoo.co.uk>
Date:   Wed Aug 25 14:34:04 2010 +0200

mscoree/tests: Add a few tests for GetCORSytemDirectory.

---

 dlls/mscoree/tests/mscoree.c |   26 +++++++++++++++++++++++---
 1 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/dlls/mscoree/tests/mscoree.c b/dlls/mscoree/tests/mscoree.c
index ba1e938..e66a44b 100644
--- a/dlls/mscoree/tests/mscoree.c
+++ b/dlls/mscoree/tests/mscoree.c
@@ -21,6 +21,7 @@
 static HMODULE hmscoree;
 
 static HRESULT (WINAPI *pGetCORVersion)(LPWSTR, DWORD, DWORD*);
+static HRESULT (WINAPI *pGetCORSystemDirectory)(LPWSTR, DWORD, DWORD*);
 
 static BOOL init_functionpointers(void)
 {
@@ -33,8 +34,8 @@ static BOOL init_functionpointers(void)
     }
 
     pGetCORVersion = (void *)GetProcAddress(hmscoree, "GetCORVersion");
-
-    if (!pGetCORVersion)
+    pGetCORSystemDirectory = (void *)GetProcAddress(hmscoree, "GetCORSystemDirectory");
+    if (!pGetCORVersion || !pGetCORSystemDirectory)
     {
         win_skip("functions not available\n");
         FreeLibrary(hmscoree);
@@ -47,7 +48,8 @@ static BOOL init_functionpointers(void)
 static void test_versioninfo(void)
 {
     WCHAR version[MAX_PATH];
-    DWORD size;
+    WCHAR path[MAX_PATH];
+    DWORD size, path_len;
     HRESULT hr;
 
     hr =  pGetCORVersion(NULL, MAX_PATH, &size);
@@ -60,6 +62,24 @@ static void test_versioninfo(void)
     ok(hr == S_OK,"GetCORVersion returned %08x\n", hr);
 
     trace("latest installed .net runtime: %s\n", wine_dbgstr_w(version));
+
+    hr = pGetCORSystemDirectory(path, MAX_PATH , &size);
+    ok(hr == S_OK, "GetCORSystemDirectory returned %08x\n", hr);
+    /* size includes terminating null-character */
+    ok(size == (lstrlenW(path) + 1),"size is %d instead of %d\n", size, (lstrlenW(path) + 1));
+
+    path_len = size;
+
+    hr = pGetCORSystemDirectory(path, path_len-1 , &size);
+    todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), "GetCORSystemDirectory returned %08x\n", hr);
+
+    hr = pGetCORSystemDirectory(NULL, MAX_PATH , &size);
+    todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), "GetCORSystemDirectory returned %08x\n", hr);
+
+    hr = pGetCORSystemDirectory(path, MAX_PATH , NULL);
+    ok(hr == E_POINTER,"GetCORSystemDirectory returned %08x\n", hr);
+
+    trace("latest installed .net installed in directory: %s\n", wine_dbgstr_w(path));
 }
 
 START_TEST(mscoree)




More information about the wine-cvs mailing list