Commit f921ae8b authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

fusion/tests: Use wide-char string literals.

parent 4031a388
...@@ -47,8 +47,6 @@ static BOOL init_functionpointers(void) ...@@ -47,8 +47,6 @@ static BOOL init_functionpointers(void)
HMODULE hfusion; HMODULE hfusion;
HMODULE hmscoree; HMODULE hmscoree;
static const WCHAR szFusion[] = {'f','u','s','i','o','n','.','d','l','l',0};
hmscoree = LoadLibraryA("mscoree.dll"); hmscoree = LoadLibraryA("mscoree.dll");
if (!hmscoree) if (!hmscoree)
{ {
...@@ -64,7 +62,7 @@ static BOOL init_functionpointers(void) ...@@ -64,7 +62,7 @@ static BOOL init_functionpointers(void)
return FALSE; return FALSE;
} }
hr = pLoadLibraryShim(szFusion, NULL, NULL, &hfusion); hr = pLoadLibraryShim(L"fusion.dll", NULL, NULL, &hfusion);
if (FAILED(hr)) if (FAILED(hr))
{ {
win_skip("fusion.dll not available\n"); win_skip("fusion.dll not available\n");
......
...@@ -48,8 +48,6 @@ static BOOL init_functionpointers(void) ...@@ -48,8 +48,6 @@ static BOOL init_functionpointers(void)
HMODULE hfusion; HMODULE hfusion;
HMODULE hmscoree; HMODULE hmscoree;
static const WCHAR szFusion[] = {'f','u','s','i','o','n','.','d','l','l',0};
hmscoree = LoadLibraryA("mscoree.dll"); hmscoree = LoadLibraryA("mscoree.dll");
if (!hmscoree) if (!hmscoree)
return FALSE; return FALSE;
...@@ -61,7 +59,7 @@ static BOOL init_functionpointers(void) ...@@ -61,7 +59,7 @@ static BOOL init_functionpointers(void)
return FALSE; return FALSE;
} }
hr = pLoadLibraryShim(szFusion, NULL, NULL, &hfusion); hr = pLoadLibraryShim(L"fusion.dll", NULL, NULL, &hfusion);
if (FAILED(hr)) if (FAILED(hr))
return FALSE; return FALSE;
...@@ -400,8 +398,6 @@ static void test_CreateAssemblyNameObject(void) ...@@ -400,8 +398,6 @@ static void test_CreateAssemblyNameObject(void)
PEKIND arch; PEKIND arch;
HRESULT hr; HRESULT hr;
static const WCHAR empty[] = {0};
/* NULL ppAssemblyNameObj */ /* NULL ppAssemblyNameObj */
to_widechar(namestr, "wine.dll"); to_widechar(namestr, "wine.dll");
hr = pCreateAssemblyNameObject(NULL, namestr, 0, NULL); hr = pCreateAssemblyNameObject(NULL, namestr, 0, NULL);
...@@ -415,7 +411,7 @@ static void test_CreateAssemblyNameObject(void) ...@@ -415,7 +411,7 @@ static void test_CreateAssemblyNameObject(void)
/* empty szAssemblyName, CANOF_PARSE_DISPLAY_NAME */ /* empty szAssemblyName, CANOF_PARSE_DISPLAY_NAME */
name = (IAssemblyName *)0xdeadbeef; name = (IAssemblyName *)0xdeadbeef;
hr = pCreateAssemblyNameObject(&name, empty, CANOF_PARSE_DISPLAY_NAME, NULL); hr = pCreateAssemblyNameObject(&name, L"", CANOF_PARSE_DISPLAY_NAME, NULL);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr); ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
ok(name == (IAssemblyName *)0xdeadbeef, "Expected 0xdeadbeef, got %p\n", name); ok(name == (IAssemblyName *)0xdeadbeef, "Expected 0xdeadbeef, got %p\n", name);
...@@ -459,7 +455,7 @@ static void test_CreateAssemblyNameObject(void) ...@@ -459,7 +455,7 @@ static void test_CreateAssemblyNameObject(void)
/* empty szAssemblyName */ /* empty szAssemblyName */
name = NULL; name = NULL;
hr = pCreateAssemblyNameObject(&name, empty, CANOF_SET_DEFAULT_VALUES, NULL); hr = pCreateAssemblyNameObject(&name, L"", CANOF_SET_DEFAULT_VALUES, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
ok(name != NULL, "Expected non-NULL name\n"); ok(name != NULL, "Expected non-NULL name\n");
...@@ -1008,27 +1004,13 @@ static void test_CreateAssemblyNameObject(void) ...@@ -1008,27 +1004,13 @@ static void test_CreateAssemblyNameObject(void)
static void test_IAssemblyName_IsEqual(void) static void test_IAssemblyName_IsEqual(void)
{ {
static const WCHAR wine1[] =
{'w','i','n','e',0};
static const WCHAR wine2[] =
{'w','i','n','e',',','v','e','r','s','i','o','n','=','1','.','0','.','0','.','0',0};
static const WCHAR wine3[] =
{'w','i','n','e',',','v','e','r','s','i','o','n','=','1','.','0','.','0','.','0',',',
'c','u','l','t','u','r','e','=','n','e','u','t','r','a','l',0};
static const WCHAR wine4[] =
{'w','i','n','e',',','v','e','r','s','i','o','n','=','1','.','0','.','0','.','0',',',
'c','u','l','t','u','r','e','=','e','n',0};
static const WCHAR wine5[] =
{'w','i','n','e',',','v','e','r','s','i','o','n','=','1','.','0','.','0','.','0',',',
'p','u','b','l','i','c','K','e','y','T','o','k','e','n','=','1','2','3','4','5','6',
'7','8','9','0','a','b','c','d','e','f',0};
HRESULT hr; HRESULT hr;
IAssemblyName *name1, *name2; IAssemblyName *name1, *name2;
hr = pCreateAssemblyNameObject( &name1, wine1, CANOF_PARSE_DISPLAY_NAME, NULL ); hr = pCreateAssemblyNameObject( &name1, L"wine", CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == S_OK, "got %08x\n", hr ); ok( hr == S_OK, "got %08x\n", hr );
hr = pCreateAssemblyNameObject( &name2, wine1, CANOF_PARSE_DISPLAY_NAME, NULL ); hr = pCreateAssemblyNameObject( &name2, L"wine", CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == S_OK, "got %08x\n", hr ); ok( hr == S_OK, "got %08x\n", hr );
if (0) { /* crashes on some old version */ if (0) { /* crashes on some old version */
...@@ -1046,32 +1028,35 @@ static void test_IAssemblyName_IsEqual(void) ...@@ -1046,32 +1028,35 @@ static void test_IAssemblyName_IsEqual(void)
ok( hr == S_OK, "got %08x\n", hr ); ok( hr == S_OK, "got %08x\n", hr );
IAssemblyName_Release( name2 ); IAssemblyName_Release( name2 );
hr = pCreateAssemblyNameObject( &name2, wine2, CANOF_PARSE_DISPLAY_NAME, NULL ); hr = pCreateAssemblyNameObject( &name2, L"wine,version=1.0.0.0", CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == S_OK, "got %08x\n", hr ); ok( hr == S_OK, "got %08x\n", hr );
hr = IAssemblyName_IsEqual( name1, name2, ASM_CMPF_IL_ALL ); hr = IAssemblyName_IsEqual( name1, name2, ASM_CMPF_IL_ALL );
ok( hr == S_OK, "got %08x\n", hr ); ok( hr == S_OK, "got %08x\n", hr );
IAssemblyName_Release( name2 ); IAssemblyName_Release( name2 );
hr = pCreateAssemblyNameObject( &name2, wine3, CANOF_PARSE_DISPLAY_NAME, NULL ); hr = pCreateAssemblyNameObject( &name2, L"wine,version=1.0.0.0,culture=neutral",
CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == S_OK, "got %08x\n", hr ); ok( hr == S_OK, "got %08x\n", hr );
hr = IAssemblyName_IsEqual( name1, name2, ASM_CMPF_IL_ALL ); hr = IAssemblyName_IsEqual( name1, name2, ASM_CMPF_IL_ALL );
ok( hr == S_OK, "got %08x\n", hr ); ok( hr == S_OK, "got %08x\n", hr );
IAssemblyName_Release( name1 ); IAssemblyName_Release( name1 );
hr = pCreateAssemblyNameObject( &name1, wine4, CANOF_PARSE_DISPLAY_NAME, NULL ); hr = pCreateAssemblyNameObject( &name1, L"wine,version=1.0.0.0,culture=en",
CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == S_OK, "got %08x\n", hr ); ok( hr == S_OK, "got %08x\n", hr );
hr = IAssemblyName_IsEqual( name1, name2, ASM_CMPF_IL_ALL ); hr = IAssemblyName_IsEqual( name1, name2, ASM_CMPF_IL_ALL );
ok( hr == S_FALSE, "got %08x\n", hr ); ok( hr == S_FALSE, "got %08x\n", hr );
IAssemblyName_Release( name1 ); IAssemblyName_Release( name1 );
hr = pCreateAssemblyNameObject( &name1, wine1, CANOF_PARSE_DISPLAY_NAME, NULL ); hr = pCreateAssemblyNameObject( &name1, L"wine", CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == S_OK, "got %08x\n", hr ); ok( hr == S_OK, "got %08x\n", hr );
IAssemblyName_Release( name2 ); IAssemblyName_Release( name2 );
hr = pCreateAssemblyNameObject( &name2, wine5, CANOF_PARSE_DISPLAY_NAME, NULL ); hr = pCreateAssemblyNameObject( &name2, L"wine,version=1.0.0.0,publicKeyToken=1234567890abcdef",
CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == S_OK, "got %08x\n", hr ); ok( hr == S_OK, "got %08x\n", hr );
hr = IAssemblyName_IsEqual( name1, name2, ASM_CMPF_IL_ALL ); hr = IAssemblyName_IsEqual( name1, name2, ASM_CMPF_IL_ALL );
......
...@@ -35,8 +35,6 @@ static BOOL init_functionpointers(void) ...@@ -35,8 +35,6 @@ static BOOL init_functionpointers(void)
HRESULT hr; HRESULT hr;
HMODULE hfusion; HMODULE hfusion;
static const WCHAR szFusion[] = {'f','u','s','i','o','n','.','d','l','l',0};
hmscoree = LoadLibraryA("mscoree.dll"); hmscoree = LoadLibraryA("mscoree.dll");
if (!hmscoree) if (!hmscoree)
{ {
...@@ -54,7 +52,7 @@ static BOOL init_functionpointers(void) ...@@ -54,7 +52,7 @@ static BOOL init_functionpointers(void)
pGetCORVersion = (void *)GetProcAddress(hmscoree, "GetCORVersion"); pGetCORVersion = (void *)GetProcAddress(hmscoree, "GetCORVersion");
hr = pLoadLibraryShim(szFusion, NULL, NULL, &hfusion); hr = pLoadLibraryShim(L"fusion.dll", NULL, NULL, &hfusion);
if (FAILED(hr)) if (FAILED(hr))
{ {
win_skip("fusion.dll not available\n"); win_skip("fusion.dll not available\n");
...@@ -76,11 +74,6 @@ static void test_GetCachePath(void) ...@@ -76,11 +74,6 @@ static void test_GetCachePath(void)
DWORD size; DWORD size;
HRESULT hr; HRESULT hr;
static const WCHAR backslash[] = {'\\',0};
static const WCHAR nochange[] = {'n','o','c','h','a','n','g','e',0};
static const WCHAR assembly[] = {'a','s','s','e','m','b','l','y',0};
static const WCHAR gac[] = {'G','A','C',0};
if (!pGetCachePath) if (!pGetCachePath)
{ {
win_skip("GetCachePath not implemented\n"); win_skip("GetCachePath not implemented\n");
...@@ -90,10 +83,7 @@ static void test_GetCachePath(void) ...@@ -90,10 +83,7 @@ static void test_GetCachePath(void)
GetWindowsDirectoryA(windirA, MAX_PATH); GetWindowsDirectoryA(windirA, MAX_PATH);
MultiByteToWideChar(CP_ACP, 0, windirA, -1, windir, MAX_PATH); MultiByteToWideChar(CP_ACP, 0, windirA, -1, windir, MAX_PATH);
lstrcpyW(cachepath, windir); lstrcpyW(cachepath, windir);
lstrcatW(cachepath, backslash); lstrcatW(cachepath, L"\\assembly\\GAC");
lstrcatW(cachepath, assembly);
lstrcatW(cachepath, backslash);
lstrcatW(cachepath, gac);
/* NULL pwzCachePath, pcchPath is 0 */ /* NULL pwzCachePath, pcchPath is 0 */
size = 0; size = 0;
...@@ -114,31 +104,32 @@ static void test_GetCachePath(void) ...@@ -114,31 +104,32 @@ static void test_GetCachePath(void)
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr); ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
/* NULL pcchPath */ /* NULL pcchPath */
lstrcpyW(path, nochange); lstrcpyW(path, L"nochange");
hr = pGetCachePath(ASM_CACHE_GAC, path, NULL); hr = pGetCachePath(ASM_CACHE_GAC, path, NULL);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr); ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
ok( !lstrcmpW( nochange, path ), "Expected %s, got %s\n", wine_dbgstr_w(nochange), wine_dbgstr_w(path)); ok(!lstrcmpW(L"nochange", path), "Expected %s, got %s\n", wine_dbgstr_w(L"nochange"),
wine_dbgstr_w(path));
/* get the cache path */ /* get the cache path */
lstrcpyW(path, nochange); lstrcpyW(path, L"nochange");
size = MAX_PATH; size = MAX_PATH;
hr = pGetCachePath(ASM_CACHE_GAC, path, &size); hr = pGetCachePath(ASM_CACHE_GAC, path, &size);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
ok( !lstrcmpW( cachepath, path ), "Expected %s, got %s\n", wine_dbgstr_w(cachepath), wine_dbgstr_w(path)); ok( !lstrcmpW( cachepath, path ), "Expected %s, got %s\n", wine_dbgstr_w(cachepath), wine_dbgstr_w(path));
/* pcchPath has no room for NULL terminator */ /* pcchPath has no room for NULL terminator */
lstrcpyW(path, nochange); lstrcpyW(path, L"nochange");
size = lstrlenW(cachepath); size = lstrlenW(cachepath);
hr = pGetCachePath(ASM_CACHE_GAC, path, &size); hr = pGetCachePath(ASM_CACHE_GAC, path, &size);
ok(hr == E_NOT_SUFFICIENT_BUFFER, "Expected E_NOT_SUFFICIENT_BUFFER, got %08x\n", hr); ok(hr == E_NOT_SUFFICIENT_BUFFER, "Expected E_NOT_SUFFICIENT_BUFFER, got %08x\n", hr);
ok( !lstrcmpW( nochange, path ), "Expected %s, got %s\n", wine_dbgstr_w(nochange), wine_dbgstr_w(path)); ok(!lstrcmpW(L"nochange", path), "Expected %s, got %s\n", wine_dbgstr_w(L"nochange"),
wine_dbgstr_w(path));
lstrcpyW(cachepath, windir); lstrcpyW(cachepath, windir);
lstrcatW(cachepath, backslash); lstrcatW(cachepath, L"\\assembly");
lstrcatW(cachepath, assembly);
/* ASM_CACHE_ROOT */ /* ASM_CACHE_ROOT */
lstrcpyW(path, nochange); lstrcpyW(path, L"nochange");
size = MAX_PATH; size = MAX_PATH;
hr = pGetCachePath(ASM_CACHE_ROOT, path, &size); hr = pGetCachePath(ASM_CACHE_ROOT, path, &size);
ok(hr == S_OK || ok(hr == S_OK ||
...@@ -176,7 +167,7 @@ static void test_GetCachePath(void) ...@@ -176,7 +167,7 @@ static void test_GetCachePath(void)
MultiByteToWideChar(CP_ACP, 0, cachepathA, -1, cachepath, MAX_PATH); MultiByteToWideChar(CP_ACP, 0, cachepathA, -1, cachepath, MAX_PATH);
/* ASM_CACHE_ZAP */ /* ASM_CACHE_ZAP */
lstrcpyW(path, nochange); lstrcpyW(path, L"nochange");
size = MAX_PATH; size = MAX_PATH;
hr = pGetCachePath(ASM_CACHE_ZAP, path, &size); hr = pGetCachePath(ASM_CACHE_ZAP, path, &size);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
...@@ -184,11 +175,12 @@ static void test_GetCachePath(void) ...@@ -184,11 +175,12 @@ static void test_GetCachePath(void)
} }
/* two flags at once */ /* two flags at once */
lstrcpyW(path, nochange); lstrcpyW(path, L"nochange");
size = MAX_PATH; size = MAX_PATH;
hr = pGetCachePath(ASM_CACHE_GAC | ASM_CACHE_ROOT, path, &size); hr = pGetCachePath(ASM_CACHE_GAC | ASM_CACHE_ROOT, path, &size);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr); ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
ok( !lstrcmpW( nochange, path ), "Expected %s, got %s\n", wine_dbgstr_w(nochange), wine_dbgstr_w(path)); ok(!lstrcmpW(L"nochange", path), "Expected %s, got %s\n", wine_dbgstr_w(L"nochange"),
wine_dbgstr_w(path));
} }
START_TEST(fusion) START_TEST(fusion)
......
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