fusion/tests: Fix a few test failures on .NET 1.x.

This commit is contained in:
Paul Vriens 2009-02-27 09:51:15 +01:00 committed by Alexandre Julliard
parent 04ad995cf6
commit c71348ff58
1 changed files with 41 additions and 35 deletions

View File

@ -694,10 +694,51 @@ static void test_CreateAssemblyNameObject(void)
IAssemblyName_Release(name); 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 */ /* PublicKeyToken is not 16 chars long */
to_widechar(namestr, "wine, PublicKeyToken=567890abcdef"); to_widechar(namestr, "wine, PublicKeyToken=567890abcdef");
name = (IAssemblyName *)0xdeadbeef; name = (IAssemblyName *)0xdeadbeef;
hr = pCreateAssemblyNameObject(&name, namestr, CANOF_PARSE_DISPLAY_NAME, NULL); 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, ok(hr == FUSION_E_INVALID_NAME,
"Expected FUSION_E_INVALID_NAME, got %08x\n", hr); "Expected FUSION_E_INVALID_NAME, got %08x\n", hr);
ok(name == (IAssemblyName *)0xdeadbeef, "Expected 0xdeadbeef, got %p\n", name); 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, ok(hr == FUSION_E_INVALID_NAME,
"Expected FUSION_E_INVALID_NAME, got %08x\n", hr); "Expected FUSION_E_INVALID_NAME, got %08x\n", hr);
ok(name == (IAssemblyName *)0xdeadbeef, "Expected 0xdeadbeef, got %p\n", name); 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) START_TEST(asmname)