d3dx10/tests: Don't fail tests when WMP support is missing.

That's apparently the case on Vista (and Wine when compiled without
jxrlib).

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51305
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Matteo Bruni 2021-08-11 19:18:55 +02:00 committed by Alexandre Julliard
parent 451dede7c0
commit da217f9bd3
1 changed files with 12 additions and 6 deletions

View File

@ -1887,7 +1887,8 @@ static void test_get_image_info(void)
winetest_push_context("Test %u", i); winetest_push_context("Test %u", i);
hr = D3DX10GetImageInfoFromMemory(test_image[i].data, test_image[i].size, NULL, &image_info, NULL); hr = D3DX10GetImageInfoFromMemory(test_image[i].data, test_image[i].size, NULL, &image_info, NULL);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ok(hr == S_OK || (hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP),
"Got unexpected hr %#x.\n", hr);
if (hr == S_OK) if (hr == S_OK)
check_image_info(&image_info, test_image + i, __LINE__); check_image_info(&image_info, test_image + i, __LINE__);
@ -1909,12 +1910,14 @@ static void test_get_image_info(void)
create_file(test_filename, test_image[i].data, test_image[i].size, path); create_file(test_filename, test_image[i].data, test_image[i].size, path);
hr = D3DX10GetImageInfoFromFileW(path, NULL, &image_info, NULL); hr = D3DX10GetImageInfoFromFileW(path, NULL, &image_info, NULL);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ok(hr == S_OK || (hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP),
"Got unexpected hr %#x.\n", hr);
if (hr == S_OK) if (hr == S_OK)
check_image_info(&image_info, test_image + i, __LINE__); check_image_info(&image_info, test_image + i, __LINE__);
hr = D3DX10GetImageInfoFromFileA(get_str_a(path), NULL, &image_info, NULL); hr = D3DX10GetImageInfoFromFileA(get_str_a(path), NULL, &image_info, NULL);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ok(hr == S_OK || (hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP),
"Got unexpected hr %#x.\n", hr);
if (hr == S_OK) if (hr == S_OK)
check_image_info(&image_info, test_image + i, __LINE__); check_image_info(&image_info, test_image + i, __LINE__);
@ -1940,12 +1943,14 @@ static void test_get_image_info(void)
resource_module = create_resource_module(test_resource_name, test_image[i].data, test_image[i].size); resource_module = create_resource_module(test_resource_name, test_image[i].data, test_image[i].size);
hr = D3DX10GetImageInfoFromResourceW(resource_module, test_resource_name, NULL, &image_info, NULL); hr = D3DX10GetImageInfoFromResourceW(resource_module, test_resource_name, NULL, &image_info, NULL);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ok(hr == S_OK || (hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP),
"Got unexpected hr %#x.\n", hr);
if (hr == S_OK) if (hr == S_OK)
check_image_info(&image_info, test_image + i, __LINE__); check_image_info(&image_info, test_image + i, __LINE__);
hr = D3DX10GetImageInfoFromResourceA(resource_module, get_str_a(test_resource_name), NULL, &image_info, NULL); hr = D3DX10GetImageInfoFromResourceA(resource_module, get_str_a(test_resource_name), NULL, &image_info, NULL);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ok(hr == S_OK || (hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP),
"Got unexpected hr %#x.\n", hr);
if (hr == S_OK) if (hr == S_OK)
check_image_info(&image_info, test_image + i, __LINE__); check_image_info(&image_info, test_image + i, __LINE__);
@ -2000,7 +2005,8 @@ static void test_create_texture(void)
hr = D3DX10CreateTextureFromMemory(device, test_image[i].data, test_image[i].size, NULL, NULL, &resource, NULL); hr = D3DX10CreateTextureFromMemory(device, test_image[i].data, test_image[i].size, NULL, NULL, &resource, NULL);
todo_wine_if(test_image[i].expected_info.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE) todo_wine_if(test_image[i].expected_info.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE)
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ok(hr == S_OK || (hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP),
"Got unexpected hr %#x.\n", hr);
if (hr == S_OK) if (hr == S_OK)
{ {
check_resource_info(resource, test_image + i, __LINE__); check_resource_info(resource, test_image + i, __LINE__);