From c71348ff58e8e0a50ae0429b5376af97a43de1fb Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Fri, 27 Feb 2009 09:51:15 +0100 Subject: [PATCH] fusion/tests: Fix a few test failures on .NET 1.x. --- dlls/fusion/tests/asmname.c | 76 ++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/dlls/fusion/tests/asmname.c b/dlls/fusion/tests/asmname.c index a926b8757c8..4592850666b 100644 --- a/dlls/fusion/tests/asmname.c +++ b/dlls/fusion/tests/asmname.c @@ -694,10 +694,51 @@ static void test_CreateAssemblyNameObject(void) IAssemblyName_Release(name); + /* invalid property */ + to_widechar(namestr, "wine, BadProp=42"); + name = NULL; + hr = pCreateAssemblyNameObject(&name, namestr, CANOF_PARSE_DISPLAY_NAME, NULL); + ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + ok(name != NULL, "Expected non-NULL name\n"); + + size = MAX_PATH; + hr = IAssemblyName_GetDisplayName(name, str, &size, ASM_DISPLAYF_FULL); + ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + todo_wine + { + ok_aw("wine", str); + ok(size == 5, "Expected 5, got %d\n", size); + } + + size = MAX_PATH; + str[0] = '\0'; + hr = IAssemblyName_GetName(name, &size, str); + ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + ok_aw("wine", str); + ok(size == 5, "Expected 5, got %d\n", size); + + hi = 0xbeefcace; + lo = 0xcafebabe; + hr = IAssemblyName_GetVersion(name, &hi, &lo); + ok(hr == FUSION_E_INVALID_NAME, + "Expected FUSION_E_INVALID_NAME, got %08x\n", hr); + ok(hi == 0, "Expected 0, got %08x\n", hi); + ok(lo == 0, "Expected 0, got %08x\n", lo); + + test_assembly_name_props(name, winename); + + IAssemblyName_Release(name); + /* PublicKeyToken is not 16 chars long */ to_widechar(namestr, "wine, PublicKeyToken=567890abcdef"); name = (IAssemblyName *)0xdeadbeef; hr = pCreateAssemblyNameObject(&name, namestr, CANOF_PARSE_DISPLAY_NAME, NULL); + if (hr == S_OK && name != (IAssemblyName *)0xdeadbeef) + { + win_skip(".NET 1.x doesn't check PublicKeyToken correctly\n"); + IAssemblyName_Release(name); + return; + } ok(hr == FUSION_E_INVALID_NAME, "Expected FUSION_E_INVALID_NAME, got %08x\n", hr); ok(name == (IAssemblyName *)0xdeadbeef, "Expected 0xdeadbeef, got %p\n", name); @@ -736,41 +777,6 @@ static void test_CreateAssemblyNameObject(void) ok(hr == FUSION_E_INVALID_NAME, "Expected FUSION_E_INVALID_NAME, got %08x\n", hr); ok(name == (IAssemblyName *)0xdeadbeef, "Expected 0xdeadbeef, got %p\n", name); - - /* invalid property */ - to_widechar(namestr, "wine, BadProp=42"); - name = NULL; - hr = pCreateAssemblyNameObject(&name, namestr, CANOF_PARSE_DISPLAY_NAME, NULL); - ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); - ok(name != NULL, "Expected non-NULL name\n"); - - size = MAX_PATH; - hr = IAssemblyName_GetDisplayName(name, str, &size, ASM_DISPLAYF_FULL); - ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); - todo_wine - { - ok_aw("wine", str); - ok(size == 5, "Expected 5, got %d\n", size); - } - - size = MAX_PATH; - str[0] = '\0'; - hr = IAssemblyName_GetName(name, &size, str); - ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); - ok_aw("wine", str); - ok(size == 5, "Expected 5, got %d\n", size); - - hi = 0xbeefcace; - lo = 0xcafebabe; - hr = IAssemblyName_GetVersion(name, &hi, &lo); - ok(hr == FUSION_E_INVALID_NAME, - "Expected FUSION_E_INVALID_NAME, got %08x\n", hr); - ok(hi == 0, "Expected 0, got %08x\n", hi); - ok(lo == 0, "Expected 0, got %08x\n", lo); - - test_assembly_name_props(name, winename); - - IAssemblyName_Release(name); } START_TEST(asmname)