Commit 365852c0 authored by Ivan Gyurdiev's avatar Ivan Gyurdiev Committed by Alexandre Julliard

d3d9/tests: Printf format fixes for d3d9 tests.

parent 1eea5c21
......@@ -5,7 +5,6 @@ VPATH = @srcdir@
TESTDLL = d3d9.dll
IMPORTS = user32 kernel32
EXTRALIBS = -ldxerr9 -luuid -ldxguid
EXTRADEFS = -DWINE_NO_LONG_AS_INT
CTESTS = \
device.c \
......
......@@ -57,7 +57,7 @@ static void check_mipmap_levels(
if (SUCCEEDED(hr)) {
DWORD levels = IDirect3DBaseTexture9_GetLevelCount(texture);
ok(levels == count, "Invalid level count. Expected %d got %lu\n", count, levels);
ok(levels == count, "Invalid level count. Expected %d got %u\n", count, levels);
} else
trace("CreateTexture failed: %s\n", DXGetErrorString9(hr));
......@@ -427,46 +427,46 @@ static void test_cursor(void)
if (FAILED(hr)) goto cleanup;
IDirect3DDevice9_CreateOffscreenPlainSurface(pDevice, 32, 32, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &cursor, 0);
ok(cursor != NULL, "IDirect3DDevice9_CreateOffscreenPlainSurface failed with %08lx\n", hr);
ok(cursor != NULL, "IDirect3DDevice9_CreateOffscreenPlainSurface failed with %08x\n", hr);
/* Initially hidden */
hr = IDirect3DDevice9_ShowCursor(pDevice, TRUE);
ok(hr == FALSE, "IDirect3DDevice9_ShowCursor returned %08lx\n", hr);
ok(hr == FALSE, "IDirect3DDevice9_ShowCursor returned %08x\n", hr);
/* Not enabled without a surface*/
hr = IDirect3DDevice9_ShowCursor(pDevice, TRUE);
ok(hr == FALSE, "IDirect3DDevice9_ShowCursor returned %08lx\n", hr);
ok(hr == FALSE, "IDirect3DDevice9_ShowCursor returned %08x\n", hr);
/* Fails */
hr = IDirect3DDevice9_SetCursorProperties(pDevice, 0, 0, NULL);
ok(hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_SetCursorProperties returned %08lx\n", hr);
ok(hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_SetCursorProperties returned %08x\n", hr);
hr = IDirect3DDevice9_SetCursorProperties(pDevice, 0, 0, cursor);
ok(hr == D3D_OK, "IDirect3DDevice9_SetCursorProperties returned %08lx\n", hr);
ok(hr == D3D_OK, "IDirect3DDevice9_SetCursorProperties returned %08x\n", hr);
IDirect3DSurface9_Release(cursor);
memset(&info, 0, sizeof(info));
info.cbSize = sizeof(info);
hr = GetCursorInfo(&info);
ok(hr != 0, "GetCursorInfo returned %08lx\n", hr);
ok(info.flags & CURSOR_SHOWING, "The gdi cursor is hidden (%08lx)\n", info.flags);
ok(hr != 0, "GetCursorInfo returned %08x\n", hr);
ok(info.flags & CURSOR_SHOWING, "The gdi cursor is hidden (%08x)\n", info.flags);
ok(info.hCursor == cur, "The cursor handle is %p\n", info.hCursor); /* unchanged */
/* Still hidden */
hr = IDirect3DDevice9_ShowCursor(pDevice, TRUE);
ok(hr == FALSE, "IDirect3DDevice9_ShowCursor returned %08lx\n", hr);
ok(hr == FALSE, "IDirect3DDevice9_ShowCursor returned %08x\n", hr);
/* Enabled now*/
hr = IDirect3DDevice9_ShowCursor(pDevice, TRUE);
ok(hr == TRUE, "IDirect3DDevice9_ShowCursor returned %08lx\n", hr);
ok(hr == TRUE, "IDirect3DDevice9_ShowCursor returned %08x\n", hr);
/* GDI cursor unchanged */
memset(&info, 0, sizeof(info));
info.cbSize = sizeof(info);
hr = GetCursorInfo(&info);
ok(hr != 0, "GetCursorInfo returned %08lx\n", hr);
ok(info.flags & CURSOR_SHOWING, "The gdi cursor is hidden (%08lx)\n", info.flags);
ok(hr != 0, "GetCursorInfo returned %08x\n", hr);
ok(info.flags & CURSOR_SHOWING, "The gdi cursor is hidden (%08x)\n", info.flags);
ok(info.hCursor == cur, "The cursor handle is %p\n", info.hCursor); /* unchanged */
cleanup:
......
......@@ -55,7 +55,7 @@ static IDirect3DDevice9 *init_d3d9(void)
present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
hres = IDirect3D9_CreateDevice(d3d9_ptr, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, NULL, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device_ptr);
ok(hres == D3D_OK, "IDirect3D_CreateDevice returned: 0x%lx\n", hres);
ok(hres == D3D_OK, "IDirect3D_CreateDevice returned: 0x%x\n", hres);
return device_ptr;
}
......@@ -84,24 +84,24 @@ static void test_get_set_vertex_shader(IDirect3DDevice9 *device_ptr)
int i = 0;
hret = IDirect3DDevice9_CreateVertexShader(device_ptr, simple_vs, &shader_ptr);
ok(hret == D3D_OK && shader_ptr != NULL, "CreateVertexShader returned: hret 0x%lx, shader_ptr %p. "
"Expected hret 0x%lx, shader_ptr != %p. Aborting.\n", hret, shader_ptr, D3D_OK, NULL);
ok(hret == D3D_OK && shader_ptr != NULL, "CreateVertexShader returned: hret 0x%x, shader_ptr %p. "
"Expected hret 0x%x, shader_ptr != %p. Aborting.\n", hret, shader_ptr, D3D_OK, NULL);
if (hret != D3D_OK || shader_ptr == NULL) return;
/* SetVertexShader should not touch the shader's refcount. */
i = get_refcount((IUnknown *)shader_ptr);
hret = IDirect3DDevice9_SetVertexShader(device_ptr, shader_ptr);
shader_refcount = get_refcount((IUnknown *)shader_ptr);
ok(hret == D3D_OK && shader_refcount == i, "SetVertexShader returned: hret 0x%lx, refcount %d. "
"Expected hret 0x%lx, refcount %d.\n", hret, shader_refcount, D3D_OK, i);
ok(hret == D3D_OK && shader_refcount == i, "SetVertexShader returned: hret 0x%x, refcount %d. "
"Expected hret 0x%x, refcount %d.\n", hret, shader_refcount, D3D_OK, i);
/* GetVertexShader should increase the shader's refcount by one. */
i = shader_refcount+1;
hret = IDirect3DDevice9_GetVertexShader(device_ptr, &current_shader_ptr);
shader_refcount = get_refcount((IUnknown *)shader_ptr);
ok(hret == D3D_OK && shader_refcount == i && current_shader_ptr == shader_ptr,
"GetVertexShader returned: hret 0x%lx, current_shader_ptr %p refcount %d. "
"Expected hret 0x%lx, current_shader_ptr %p, refcount %d.\n", hret, current_shader_ptr, shader_refcount, D3D_OK, shader_ptr, i);
"GetVertexShader returned: hret 0x%x, current_shader_ptr %p refcount %d. "
"Expected hret 0x%x, current_shader_ptr %p, refcount %d.\n", hret, current_shader_ptr, shader_refcount, D3D_OK, shader_ptr, i);
}
static void test_get_set_pixel_shader(IDirect3DDevice9 *device_ptr)
......@@ -121,24 +121,24 @@ static void test_get_set_pixel_shader(IDirect3DDevice9 *device_ptr)
int i = 0;
hret = IDirect3DDevice9_CreatePixelShader(device_ptr, simple_ps, &shader_ptr);
ok(hret == D3D_OK && shader_ptr != NULL, "CreatePixelShader returned: hret 0x%lx, shader_ptr %p. "
"Expected hret 0x%lx, shader_ptr != %p. Aborting.\n", hret, shader_ptr, D3D_OK, NULL);
ok(hret == D3D_OK && shader_ptr != NULL, "CreatePixelShader returned: hret 0x%x, shader_ptr %p. "
"Expected hret 0x%x, shader_ptr != %p. Aborting.\n", hret, shader_ptr, D3D_OK, NULL);
if (hret != D3D_OK || shader_ptr == NULL) return;
/* SetPixelsShader should not touch the shader's refcount. */
i = get_refcount((IUnknown *)shader_ptr);
hret = IDirect3DDevice9_SetPixelShader(device_ptr, shader_ptr);
shader_refcount = get_refcount((IUnknown *)shader_ptr);
ok(hret == D3D_OK && shader_refcount == i, "SetPixelShader returned: hret 0x%lx, refcount %d. "
"Expected hret 0x%lx, refcount %d.\n", hret, shader_refcount, D3D_OK, i);
ok(hret == D3D_OK && shader_refcount == i, "SetPixelShader returned: hret 0x%x, refcount %d. "
"Expected hret 0x%x, refcount %d.\n", hret, shader_refcount, D3D_OK, i);
/* GetPixelShader should increase the shader's refcount by one. */
i = shader_refcount+1;
hret = IDirect3DDevice9_GetPixelShader(device_ptr, &current_shader_ptr);
shader_refcount = get_refcount((IUnknown *)shader_ptr);
ok(hret == D3D_OK && shader_refcount == i && current_shader_ptr == shader_ptr,
"GetPixelShader returned: hret 0x%lx, current_shader_ptr %p refcount %d. "
"Expected hret 0x%lx, current_shader_ptr %p, refcount %d.\n", hret, current_shader_ptr, shader_refcount, D3D_OK, shader_ptr, i);
"GetPixelShader returned: hret 0x%x, current_shader_ptr %p refcount %d. "
"Expected hret 0x%x, current_shader_ptr %p, refcount %d.\n", hret, current_shader_ptr, shader_refcount, D3D_OK, shader_ptr, i);
}
START_TEST(shader)
......
......@@ -53,7 +53,7 @@ static IDirect3DDevice9 *init_d3d9(HMODULE d3d9_handle)
hr = IDirect3D9_CreateDevice(d3d9_ptr, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
NULL, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device_ptr);
ok(SUCCEEDED(hr), "IDirect3D_CreateDevice returned %#lx\n", hr);
ok(SUCCEEDED(hr), "IDirect3D_CreateDevice returned %#x\n", hr);
return device_ptr;
}
......@@ -67,45 +67,45 @@ static void test_surface_get_container(IDirect3DDevice9 *device_ptr)
hr = IDirect3DDevice9_CreateTexture(device_ptr, 128, 128, 1, 0,
D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &texture_ptr, 0);
ok(SUCCEEDED(hr) && texture_ptr != NULL, "CreateTexture returned: hr %#lx, texture_ptr %p. "
"Expected hr %#lx, texture_ptr != %p\n", hr, texture_ptr, D3D_OK, NULL);
ok(SUCCEEDED(hr) && texture_ptr != NULL, "CreateTexture returned: hr %#x, texture_ptr %p. "
"Expected hr %#x, texture_ptr != %p\n", hr, texture_ptr, D3D_OK, NULL);
if (!texture_ptr || FAILED(hr)) goto cleanup;
hr = IDirect3DTexture9_GetSurfaceLevel(texture_ptr, 0, &surface_ptr);
ok(SUCCEEDED(hr) && surface_ptr != NULL, "GetSurfaceLevel returned: hr %#lx, surface_ptr %p. "
"Expected hr %#lx, surface_ptr != %p\n", hr, surface_ptr, D3D_OK, NULL);
ok(SUCCEEDED(hr) && surface_ptr != NULL, "GetSurfaceLevel returned: hr %#x, surface_ptr %p. "
"Expected hr %#x, surface_ptr != %p\n", hr, surface_ptr, D3D_OK, NULL);
if (!surface_ptr || FAILED(hr)) goto cleanup;
/* These should work... */
container_ptr = (void *)0x1337c0d3;
hr = IDirect3DSurface9_GetContainer(surface_ptr, &IID_IUnknown, &container_ptr);
ok(SUCCEEDED(hr) && container_ptr == texture_ptr, "GetContainer returned: hr %#lx, container_ptr %p. "
"Expected hr %#lx, container_ptr %p\n", hr, container_ptr, S_OK, texture_ptr);
ok(SUCCEEDED(hr) && container_ptr == texture_ptr, "GetContainer returned: hr %#x, container_ptr %p. "
"Expected hr %#x, container_ptr %p\n", hr, container_ptr, S_OK, texture_ptr);
if (container_ptr && container_ptr != (void *)0x1337c0d3) IUnknown_Release((IUnknown *)container_ptr);
container_ptr = (void *)0x1337c0d3;
hr = IDirect3DSurface9_GetContainer(surface_ptr, &IID_IDirect3DResource9, &container_ptr);
ok(SUCCEEDED(hr) && container_ptr == texture_ptr, "GetContainer returned: hr %#lx, container_ptr %p. "
"Expected hr %#lx, container_ptr %p\n", hr, container_ptr, S_OK, texture_ptr);
ok(SUCCEEDED(hr) && container_ptr == texture_ptr, "GetContainer returned: hr %#x, container_ptr %p. "
"Expected hr %#x, container_ptr %p\n", hr, container_ptr, S_OK, texture_ptr);
if (container_ptr && container_ptr != (void *)0x1337c0d3) IUnknown_Release((IUnknown *)container_ptr);
container_ptr = (void *)0x1337c0d3;
hr = IDirect3DSurface9_GetContainer(surface_ptr, &IID_IDirect3DBaseTexture9, &container_ptr);
ok(SUCCEEDED(hr) && container_ptr == texture_ptr, "GetContainer returned: hr %#lx, container_ptr %p. "
"Expected hr %#lx, container_ptr %p\n", hr, container_ptr, S_OK, texture_ptr);
ok(SUCCEEDED(hr) && container_ptr == texture_ptr, "GetContainer returned: hr %#x, container_ptr %p. "
"Expected hr %#x, container_ptr %p\n", hr, container_ptr, S_OK, texture_ptr);
if (container_ptr && container_ptr != (void *)0x1337c0d3) IUnknown_Release((IUnknown *)container_ptr);
container_ptr = (void *)0x1337c0d3;
hr = IDirect3DSurface9_GetContainer(surface_ptr, &IID_IDirect3DTexture9, &container_ptr);
ok(SUCCEEDED(hr) && container_ptr == texture_ptr, "GetContainer returned: hr %#lx, container_ptr %p. "
"Expected hr %#lx, container_ptr %p\n", hr, container_ptr, S_OK, texture_ptr);
ok(SUCCEEDED(hr) && container_ptr == texture_ptr, "GetContainer returned: hr %#x, container_ptr %p. "
"Expected hr %#x, container_ptr %p\n", hr, container_ptr, S_OK, texture_ptr);
if (container_ptr && container_ptr != (void *)0x1337c0d3) IUnknown_Release((IUnknown *)container_ptr);
/* ...and this one shouldn't. This should return E_NOINTERFACE and set container_ptr to NULL */
container_ptr = (void *)0x1337c0d3;
hr = IDirect3DSurface9_GetContainer(surface_ptr, &IID_IDirect3DSurface9, &container_ptr);
ok(hr == E_NOINTERFACE && container_ptr == NULL, "GetContainer returned: hr %#lx, container_ptr %p. "
"Expected hr %#lx, container_ptr %p\n", hr, container_ptr, E_NOINTERFACE, NULL);
ok(hr == E_NOINTERFACE && container_ptr == NULL, "GetContainer returned: hr %#x, container_ptr %p. "
"Expected hr %#x, container_ptr %p\n", hr, container_ptr, E_NOINTERFACE, NULL);
if (container_ptr && container_ptr != (void *)0x1337c0d3) IUnknown_Release((IUnknown *)container_ptr);
cleanup:
......@@ -120,13 +120,13 @@ static void test_surface_alignment(IDirect3DDevice9 *device_ptr)
/* Test a sysmem surface as those aren't affected by the hardware's np2 restrictions */
hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device_ptr, 5, 5, D3DFMT_R5G6B5, D3DPOOL_SYSTEMMEM, &surface_ptr, 0);
ok(hr == D3D_OK, "IDirect3DDevice9_CreateOffscreenPlainSurface returned %08lx\n", hr);
ok(hr == D3D_OK, "IDirect3DDevice9_CreateOffscreenPlainSurface returned %08x\n", hr);
if(surface_ptr)
{
D3DLOCKED_RECT lockedRect;
hr = IDirect3DSurface9_LockRect(surface_ptr, &lockedRect, NULL, 0);
ok(hr == D3D_OK, "IDirect3DSurface9_LockRect returned %08lx\n", hr);
ok(hr == D3D_OK, "IDirect3DSurface9_LockRect returned %08x\n", hr);
/* test is deactivated until out np2 support doesn't report the full power of 2 pitch to the app */
todo_wine ok(lockedRect.Pitch == 12, "Got pitch %d, expected 12\n", lockedRect.Pitch);
hr = IDirect3DSurface9_UnlockRect(surface_ptr);
......
......@@ -53,7 +53,7 @@ static IDirect3DDevice9 *init_d3d9(HMODULE d3d9_handle)
hr = IDirect3D9_CreateDevice(d3d9_ptr, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
NULL, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device_ptr);
ok(SUCCEEDED(hr), "IDirect3D_CreateDevice returned %#lx\n", hr);
ok(SUCCEEDED(hr), "IDirect3D_CreateDevice returned %#x\n", hr);
return device_ptr;
}
......@@ -63,8 +63,8 @@ static void test_texture_stage_state(IDirect3DDevice9 *device_ptr, DWORD stage,
DWORD value;
HRESULT hr = IDirect3DDevice9_GetTextureStageState(device_ptr, stage, type, &value);
ok(SUCCEEDED(hr) && value == expected, "GetTextureStageState (stage %#lx, type %#x) returned: hr %#lx, value %#lx. "
"Expected hr %#lx, value %#lx\n", stage, type, hr, value, D3D_OK, expected);
ok(SUCCEEDED(hr) && value == expected, "GetTextureStageState (stage %#x, type %#x) returned: hr %#x, value %#x. "
"Expected hr %#x, value %#x\n", stage, type, hr, value, D3D_OK, expected);
}
/* Test the default texture stage state values */
......
......@@ -60,7 +60,7 @@ static IDirect3DDevice9 *init_d3d9(void)
present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
hres = IDirect3D9_CreateDevice(d3d9_ptr, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, NULL, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device_ptr);
ok(hres == D3D_OK, "IDirect3D_CreateDevice returned: 0x%lx\n", hres);
ok(hres == D3D_OK, "IDirect3D_CreateDevice returned: 0x%x\n", hres);
return device_ptr;
}
......@@ -77,8 +77,8 @@ static IDirect3DVertexDeclaration9 *test_create_vertex_declaration(IDirect3DDevi
HRESULT hret = 0;
hret = IDirect3DDevice9_CreateVertexDeclaration(device_ptr, vertex_decl, &decl_ptr);
ok(hret == D3D_OK && decl_ptr != NULL, "CreateVertexDeclaration returned: hret 0x%lx, decl_ptr %p. "
"Expected hret 0x%lx, decl_ptr != %p. Aborting.\n", hret, decl_ptr, D3D_OK, NULL);
ok(hret == D3D_OK && decl_ptr != NULL, "CreateVertexDeclaration returned: hret 0x%x, decl_ptr %p. "
"Expected hret 0x%x, decl_ptr != %p. Aborting.\n", hret, decl_ptr, D3D_OK, NULL);
return decl_ptr;
}
......@@ -94,16 +94,16 @@ static void test_get_set_vertex_declaration(IDirect3DDevice9 *device_ptr, IDirec
i = get_refcount((IUnknown *)decl_ptr);
hret = IDirect3DDevice9_SetVertexDeclaration(device_ptr, decl_ptr);
decl_refcount = get_refcount((IUnknown *)decl_ptr);
ok(hret == D3D_OK && decl_refcount == i, "SetVertexDeclaration returned: hret 0x%lx, refcount %d. "
"Expected hret 0x%lx, refcount %d.\n", hret, decl_refcount, D3D_OK, i);
ok(hret == D3D_OK && decl_refcount == i, "SetVertexDeclaration returned: hret 0x%x, refcount %d. "
"Expected hret 0x%x, refcount %d.\n", hret, decl_refcount, D3D_OK, i);
/* GetVertexDeclaration should increase the declaration's refcount by one. */
i = decl_refcount+1;
hret = IDirect3DDevice9_GetVertexDeclaration(device_ptr, &current_decl_ptr);
decl_refcount = get_refcount((IUnknown *)decl_ptr);
ok(hret == D3D_OK && decl_refcount == i && current_decl_ptr == decl_ptr,
"GetVertexDeclaration returned: hret 0x%lx, current_decl_ptr %p refcount %d. "
"Expected hret 0x%lx, current_decl_ptr %p, refcount %d.\n", hret, current_decl_ptr, decl_refcount, D3D_OK, decl_ptr, i);
"GetVertexDeclaration returned: hret 0x%x, current_decl_ptr %p refcount %d. "
"Expected hret 0x%x, current_decl_ptr %p, refcount %d.\n", hret, current_decl_ptr, decl_refcount, D3D_OK, decl_ptr, i);
}
static void test_get_declaration(IDirect3DVertexDeclaration9 *decl_ptr, D3DVERTEXELEMENT9 *vertex_decl, UINT expected_num_elements)
......@@ -117,14 +117,14 @@ static void test_get_declaration(IDirect3DVertexDeclaration9 *decl_ptr, D3DVERTE
num_elements = 0x1337c0de;
hret = IDirect3DVertexDeclaration9_GetDeclaration(decl_ptr, NULL, &num_elements);
ok(hret == D3D_OK && num_elements == expected_num_elements,
"GetDeclaration returned: hret 0x%lx, num_elements %d. "
"Expected hret 0x%lx, num_elements %d.\n", hret, num_elements, D3D_OK, expected_num_elements);
"GetDeclaration returned: hret 0x%x, num_elements %d. "
"Expected hret 0x%x, num_elements %d.\n", hret, num_elements, D3D_OK, expected_num_elements);
num_elements = 0;
hret = IDirect3DVertexDeclaration9_GetDeclaration(decl_ptr, NULL, &num_elements);
ok(hret == D3D_OK && num_elements == expected_num_elements,
"GetDeclaration returned: hret 0x%lx, num_elements %d. "
"Expected hret 0x%lx, num_elements %d.\n", hret, num_elements, D3D_OK, expected_num_elements);
"GetDeclaration returned: hret 0x%x, num_elements %d. "
"Expected hret 0x%x, num_elements %d.\n", hret, num_elements, D3D_OK, expected_num_elements);
/* Also test the returned data */
decl = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(D3DVERTEXELEMENT9) * expected_num_elements);
......@@ -132,8 +132,8 @@ static void test_get_declaration(IDirect3DVertexDeclaration9 *decl_ptr, D3DVERTE
num_elements = 0x1337c0de;
hret = IDirect3DVertexDeclaration9_GetDeclaration(decl_ptr, decl, &num_elements);
ok(hret == D3D_OK && num_elements == expected_num_elements,
"GetDeclaration returned: hret 0x%lx, num_elements %d. "
"Expected hret 0x%lx, num_elements %d.\n", hret, num_elements, D3D_OK, expected_num_elements);
"GetDeclaration returned: hret 0x%x, num_elements %d. "
"Expected hret 0x%x, num_elements %d.\n", hret, num_elements, D3D_OK, expected_num_elements);
i = memcmp(decl, vertex_decl, sizeof(vertex_decl));
ok (!i, "Original and returned vertexdeclarations are not the same\n");
ZeroMemory(decl, sizeof(D3DVERTEXELEMENT9) * expected_num_elements);
......@@ -141,8 +141,8 @@ static void test_get_declaration(IDirect3DVertexDeclaration9 *decl_ptr, D3DVERTE
num_elements = 0;
hret = IDirect3DVertexDeclaration9_GetDeclaration(decl_ptr, decl, &num_elements);
ok(hret == D3D_OK && num_elements == expected_num_elements,
"GetDeclaration returned: hret 0x%lx, num_elements %d. "
"Expected hret 0x%lx, num_elements %d.\n", hret, num_elements, D3D_OK, expected_num_elements);
"GetDeclaration returned: hret 0x%x, num_elements %d. "
"Expected hret 0x%x, num_elements %d.\n", hret, num_elements, D3D_OK, expected_num_elements);
i = memcmp(decl, vertex_decl, sizeof(vertex_decl));
ok (!i, "Original and returned vertexdeclarations are not the same\n");
......@@ -168,17 +168,17 @@ static HRESULT test_fvf_to_decl(
/* Set a default declaration to make sure it is changed */
hr = IDirect3DDevice9_SetVertexDeclaration ( device, default_decl );
ok (SUCCEEDED(hr), "SetVertexDeclaration returned %#lx, expected %#lx\n", hr, D3D_OK);
ok (SUCCEEDED(hr), "SetVertexDeclaration returned %#x, expected %#x\n", hr, D3D_OK);
if (FAILED(hr)) goto fail;
/* Set an FVF */
hr = IDirect3DDevice9_SetFVF( device, test_fvf);
ok(SUCCEEDED(hr), "SetFVF returned %#lx, expected %#lx\n", hr, D3D_OK);
ok(SUCCEEDED(hr), "SetFVF returned %#x, expected %#x\n", hr, D3D_OK);
if (FAILED(hr)) goto fail;
/* Check if the declaration object changed underneath */
hr = IDirect3DDevice9_GetVertexDeclaration ( device, &result_decl);
ok(SUCCEEDED(hr), "GetVertexDeclaration returned %#lx, expected %#lx\n", hr, D3D_OK);
ok(SUCCEEDED(hr), "GetVertexDeclaration returned %#x, expected %#x\n", hr, D3D_OK);
if (FAILED(hr)) goto fail;
if (object_should_change) {
ok(result_decl != default_decl, "result declaration matches original\n");
......@@ -198,7 +198,7 @@ static HRESULT test_fvf_to_decl(
/* Check if the size changed, and abort if it did */
hr = IDirect3DVertexDeclaration9_GetDeclaration( result_decl, NULL, &result_size );
ok(SUCCEEDED(hr), "GetDeclaration returned %#lx, expected %#lx\n", hr, D3D_OK);
ok(SUCCEEDED(hr), "GetDeclaration returned %#x, expected %#x\n", hr, D3D_OK);
if (FAILED(hr)) goto fail;
ok(result_size == expected_size, "result declaration size: %d, "
"expected: %d\n", result_size, expected_size);
......@@ -207,7 +207,7 @@ static HRESULT test_fvf_to_decl(
/* Check the actual elements. Write it them in a caller-allocated array of the correct size
* That's fine, since we aborted above if the size didn't match the caller's expectations */
hr = IDirect3DVertexDeclaration9_GetDeclaration( result_decl, result_elements_ptr, &result_size );
ok(SUCCEEDED(hr), "GetDeclaration returned %#lx, expected %#lx\n", hr, D3D_OK);
ok(SUCCEEDED(hr), "GetDeclaration returned %#x, expected %#x\n", hr, D3D_OK);
if (FAILED(hr)) goto fail;
ok(result_size == expected_size, "result declaration size: %d, "
......@@ -257,25 +257,25 @@ static HRESULT test_decl_to_fvf(
/* Set a default FVF of SPECULAR and DIFFUSE to make sure it is changed back to 0 */
hr = IDirect3DDevice9_SetFVF( device, default_fvf);
ok(SUCCEEDED(hr), "SetFVF returned %#lx, expected %#lx\n", hr, D3D_OK);
ok(SUCCEEDED(hr), "SetFVF returned %#x, expected %#x\n", hr, D3D_OK);
if (FAILED(hr)) goto fail;
/* Create a testing declaration */
hr = IDirect3DDevice9_CreateVertexDeclaration( device, test_decl, &vdecl );
ok(SUCCEEDED(hr), "CreateVertexDeclaration returned %#lx, expected %#lx\n", hr, D3D_OK);
ok(SUCCEEDED(hr), "CreateVertexDeclaration returned %#x, expected %#x\n", hr, D3D_OK);
if (FAILED(hr)) goto fail;
/* Set the declaration */
hr = IDirect3DDevice9_SetVertexDeclaration ( device, vdecl );
ok (SUCCEEDED(hr), "SetVertexDeclaration returned %#lx, expected %#lx\n", hr, D3D_OK);
ok (SUCCEEDED(hr), "SetVertexDeclaration returned %#x, expected %#x\n", hr, D3D_OK);
if (FAILED(hr)) goto fail;
/* Check the FVF */
hr = IDirect3DDevice9_GetFVF( device, &result_fvf);
ok(SUCCEEDED(hr), "GetFVF returned %#lx, expected %#lx\n", hr, D3D_OK);
ok(SUCCEEDED(hr), "GetFVF returned %#x, expected %#x\n", hr, D3D_OK);
if (FAILED(hr)) goto fail;
todo_wine {
ok(test_fvf == result_fvf, "result FVF was: %#lx, expected: %#lx\n", result_fvf, test_fvf);
ok(test_fvf == result_fvf, "result FVF was: %#x, expected: %#x\n", result_fvf, test_fvf);
}
if (test_fvf != result_fvf) goto fail;
......@@ -304,7 +304,7 @@ static void test_fvf_decl_conversion(IDirect3DDevice9 *pDevice)
/* Create a default declaration and FVF that does not match any of the tests */
hr = IDirect3DDevice9_CreateVertexDeclaration( pDevice, default_elements, &default_decl );
ok(SUCCEEDED(hr), "CreateVertexDeclaration returned %#lx, expected %#lx\n", hr, D3D_OK);
ok(SUCCEEDED(hr), "CreateVertexDeclaration returned %#x, expected %#x\n", hr, D3D_OK);
if (FAILED(hr)) goto cleanup;
/* Test conversions from vertex declaration to an FVF.
......
......@@ -53,7 +53,7 @@ static IDirect3DDevice9 *init_d3d9(HMODULE d3d9_handle)
hr = IDirect3D9_CreateDevice(d3d9_ptr, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
NULL, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device_ptr);
ok(SUCCEEDED(hr), "IDirect3D_CreateDevice returned %#lx\n", hr);
ok(SUCCEEDED(hr), "IDirect3D_CreateDevice returned %#x\n", hr);
return device_ptr;
}
......@@ -67,45 +67,45 @@ static void test_volume_get_container(IDirect3DDevice9 *device_ptr)
hr = IDirect3DDevice9_CreateVolumeTexture(device_ptr, 128, 128, 128, 1, 0,
D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &texture_ptr, 0);
ok(SUCCEEDED(hr) && texture_ptr != NULL, "CreateVolumeTexture returned: hr %#lx, texture_ptr %p. "
"Expected hr %#lx, texture_ptr != %p\n", hr, texture_ptr, D3D_OK, NULL);
ok(SUCCEEDED(hr) && texture_ptr != NULL, "CreateVolumeTexture returned: hr %#x, texture_ptr %p. "
"Expected hr %#x, texture_ptr != %p\n", hr, texture_ptr, D3D_OK, NULL);
if (!texture_ptr || FAILED(hr)) goto cleanup;
hr = IDirect3DVolumeTexture9_GetVolumeLevel(texture_ptr, 0, &volume_ptr);
ok(SUCCEEDED(hr) && volume_ptr != NULL, "GetVolumeLevel returned: hr %#lx, volume_ptr %p. "
"Expected hr %#lx, volume_ptr != %p\n", hr, volume_ptr, D3D_OK, NULL);
ok(SUCCEEDED(hr) && volume_ptr != NULL, "GetVolumeLevel returned: hr %#x, volume_ptr %p. "
"Expected hr %#x, volume_ptr != %p\n", hr, volume_ptr, D3D_OK, NULL);
if (!volume_ptr || FAILED(hr)) goto cleanup;
/* These should work... */
container_ptr = (void *)0x1337c0d3;
hr = IDirect3DVolume9_GetContainer(volume_ptr, &IID_IUnknown, &container_ptr);
ok(SUCCEEDED(hr) && container_ptr == texture_ptr, "GetContainer returned: hr %#lx, container_ptr %p. "
"Expected hr %#lx, container_ptr %p\n", hr, container_ptr, S_OK, texture_ptr);
ok(SUCCEEDED(hr) && container_ptr == texture_ptr, "GetContainer returned: hr %#x, container_ptr %p. "
"Expected hr %#x, container_ptr %p\n", hr, container_ptr, S_OK, texture_ptr);
if (container_ptr && container_ptr != (void *)0x1337c0d3) IUnknown_Release((IUnknown *)container_ptr);
container_ptr = (void *)0x1337c0d3;
hr = IDirect3DVolume9_GetContainer(volume_ptr, &IID_IDirect3DResource9, &container_ptr);
ok(SUCCEEDED(hr) && container_ptr == texture_ptr, "GetContainer returned: hr %#lx, container_ptr %p. "
"Expected hr %#lx, container_ptr %p\n", hr, container_ptr, S_OK, texture_ptr);
ok(SUCCEEDED(hr) && container_ptr == texture_ptr, "GetContainer returned: hr %#x, container_ptr %p. "
"Expected hr %#x, container_ptr %p\n", hr, container_ptr, S_OK, texture_ptr);
if (container_ptr && container_ptr != (void *)0x1337c0d3) IUnknown_Release((IUnknown *)container_ptr);
container_ptr = (void *)0x1337c0d3;
hr = IDirect3DVolume9_GetContainer(volume_ptr, &IID_IDirect3DBaseTexture9, &container_ptr);
ok(SUCCEEDED(hr) && container_ptr == texture_ptr, "GetContainer returned: hr %#lx, container_ptr %p. "
"Expected hr %#lx, container_ptr %p\n", hr, container_ptr, S_OK, texture_ptr);
ok(SUCCEEDED(hr) && container_ptr == texture_ptr, "GetContainer returned: hr %#x, container_ptr %p. "
"Expected hr %#x, container_ptr %p\n", hr, container_ptr, S_OK, texture_ptr);
if (container_ptr && container_ptr != (void *)0x1337c0d3) IUnknown_Release((IUnknown *)container_ptr);
container_ptr = (void *)0x1337c0d3;
hr = IDirect3DVolume9_GetContainer(volume_ptr, &IID_IDirect3DVolumeTexture9, &container_ptr);
ok(SUCCEEDED(hr) && container_ptr == texture_ptr, "GetContainer returned: hr %#lx, container_ptr %p. "
"Expected hr %#lx, container_ptr %p\n", hr, container_ptr, S_OK, texture_ptr);
ok(SUCCEEDED(hr) && container_ptr == texture_ptr, "GetContainer returned: hr %#x, container_ptr %p. "
"Expected hr %#x, container_ptr %p\n", hr, container_ptr, S_OK, texture_ptr);
if (container_ptr && container_ptr != (void *)0x1337c0d3) IUnknown_Release((IUnknown *)container_ptr);
/* ...and this one shouldn't. This should return E_NOINTERFACE and set container_ptr to NULL */
container_ptr = (void *)0x1337c0d3;
hr = IDirect3DVolume9_GetContainer(volume_ptr, &IID_IDirect3DVolume9, &container_ptr);
ok(hr == E_NOINTERFACE && container_ptr == NULL, "GetContainer returned: hr %#lx, container_ptr %p. "
"Expected hr %#lx, container_ptr %p\n", hr, container_ptr, E_NOINTERFACE, NULL);
ok(hr == E_NOINTERFACE && container_ptr == NULL, "GetContainer returned: hr %#x, container_ptr %p. "
"Expected hr %#x, container_ptr %p\n", hr, container_ptr, E_NOINTERFACE, NULL);
if (container_ptr && container_ptr != (void *)0x1337c0d3) IUnknown_Release((IUnknown *)container_ptr);
cleanup:
......
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