d3d9/tests: Printf format fixes for d3d9 tests.

This commit is contained in:
Ivan Gyurdiev 2006-10-07 21:47:21 -04:00 committed by Alexandre Julliard
parent 1eea5c2119
commit 365852c083
8 changed files with 134 additions and 135 deletions

View File

@ -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 \

View File

@ -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:

View File

@ -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)

View File

@ -62,7 +62,7 @@ static HRESULT init_d3d9(
hres = IDirect3D9_CreateDevice(d3d9_ptr, D3DADAPTER_DEFAULT, D3DDEVTYPE_NULLREF, window,
D3DCREATE_SOFTWARE_VERTEXPROCESSING, device_pparams, device);
ok(hres == D3D_OK, "IDirect3D_CreateDevice returned: 0x%lx\n", hres);
ok(hres == D3D_OK, "IDirect3D_CreateDevice returned: 0x%x\n", hres);
return hres;
}
@ -73,27 +73,27 @@ static void test_begin_end_state_block(IDirect3DDevice9 *device_ptr)
/* Should succeed */
hret = IDirect3DDevice9_BeginStateBlock(device_ptr);
ok(hret == D3D_OK, "BeginStateBlock returned: hret 0x%lx. Expected hret 0x%lx. Aborting.\n", hret, D3D_OK);
ok(hret == D3D_OK, "BeginStateBlock returned: hret 0x%x. Expected hret 0x%x. Aborting.\n", hret, D3D_OK);
if (hret != D3D_OK) return;
/* Calling BeginStateBlock while recording should return D3DERR_INVALIDCALL */
hret = IDirect3DDevice9_BeginStateBlock(device_ptr);
ok(hret == D3DERR_INVALIDCALL, "BeginStateBlock returned: hret 0x%lx. Expected hret 0x%lx. Aborting.\n", hret, D3DERR_INVALIDCALL);
ok(hret == D3DERR_INVALIDCALL, "BeginStateBlock returned: hret 0x%x. Expected hret 0x%x. Aborting.\n", hret, D3DERR_INVALIDCALL);
if (hret != D3DERR_INVALIDCALL) return;
/* Should succeed */
state_block_ptr = (IDirect3DStateBlock9 *)0xdeadbeef;
hret = IDirect3DDevice9_EndStateBlock(device_ptr, &state_block_ptr);
ok(hret == D3D_OK && state_block_ptr != 0 && state_block_ptr != (IDirect3DStateBlock9 *)0xdeadbeef,
"EndStateBlock returned: hret 0x%lx, state_block_ptr %p. "
"Expected hret 0x%lx, state_block_ptr != %p, state_block_ptr != 0xdeadbeef.\n", hret, state_block_ptr, D3D_OK, NULL);
"EndStateBlock returned: hret 0x%x, state_block_ptr %p. "
"Expected hret 0x%x, state_block_ptr != %p, state_block_ptr != 0xdeadbeef.\n", hret, state_block_ptr, D3D_OK, NULL);
/* Calling EndStateBlock while not recording should return D3DERR_INVALIDCALL. state_block_ptr should not be touched. */
state_block_ptr = (IDirect3DStateBlock9 *)0xdeadbeef;
hret = IDirect3DDevice9_EndStateBlock(device_ptr, &state_block_ptr);
ok(hret == D3DERR_INVALIDCALL && state_block_ptr == (IDirect3DStateBlock9 *)0xdeadbeef,
"EndStateBlock returned: hret 0x%lx, state_block_ptr %p. "
"Expected hret 0x%lx, state_block_ptr 0xdeadbeef.\n", hret, state_block_ptr, D3DERR_INVALIDCALL);
"EndStateBlock returned: hret 0x%x, state_block_ptr %p. "
"Expected hret 0x%x, state_block_ptr 0xdeadbeef.\n", hret, state_block_ptr, D3DERR_INVALIDCALL);
}
/* ============================ State Testing Framework ========================== */
@ -274,22 +274,22 @@ static int switch_render_target(
/* Create new swapchain */
hret = IDirect3DDevice9_CreateAdditionalSwapChain(device, &present_parameters, &swapchain);
ok (hret == D3D_OK, "CreateAdditionalSwapChain returned %#lx.\n", hret);
ok (hret == D3D_OK, "CreateAdditionalSwapChain returned %#x.\n", hret);
if (hret != D3D_OK) goto error;
/* Get its backbuffer */
hret = IDirect3DSwapChain9_GetBackBuffer(swapchain, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer);
ok (hret == D3D_OK, "GetBackBuffer returned %#lx.\n", hret);
ok (hret == D3D_OK, "GetBackBuffer returned %#x.\n", hret);
if (hret != D3D_OK) goto error;
/* Save the current render target */
hret = IDirect3DDevice9_GetRenderTarget(device, 0, &edata->original_render_target);
ok (hret == D3D_OK, "GetRenderTarget returned %#lx.\n", hret);
ok (hret == D3D_OK, "GetRenderTarget returned %#x.\n", hret);
if (hret != D3D_OK) goto error;
/* Set the new swapchain's backbuffer as a render target */
hret = IDirect3DDevice9_SetRenderTarget(device, 0, backbuffer);
ok (hret == D3D_OK, "SetRenderTarget returned %#lx.\n", hret);
ok (hret == D3D_OK, "SetRenderTarget returned %#x.\n", hret);
if (hret != D3D_OK) goto error;
IUnknown_Release(backbuffer);
@ -311,7 +311,7 @@ static int revert_render_target(
/* Reset the old render target */
hret = IDirect3DDevice9_SetRenderTarget(device, 0, edata->original_render_target);
ok (hret == D3D_OK, "SetRenderTarget returned %#lx.\n", hret);
ok (hret == D3D_OK, "SetRenderTarget returned %#x.\n", hret);
if (hret != D3D_OK) {
IUnknown_Release(edata->original_render_target);
return EVENT_ERROR;
@ -329,7 +329,7 @@ static int begin_stateblock(
data = NULL;
hret = IDirect3DDevice9_BeginStateBlock(device);
ok(hret == D3D_OK, "BeginStateBlock returned %#lx.\n", hret);
ok(hret == D3D_OK, "BeginStateBlock returned %#x.\n", hret);
if (hret != D3D_OK) return EVENT_ERROR;
return EVENT_OK;
}
@ -342,7 +342,7 @@ static int end_stateblock(
event_data* edata = (event_data*) data;
hret = IDirect3DDevice9_EndStateBlock(device, &edata->stateblock);
ok(hret == D3D_OK, "EndStateBlock returned %#lx.\n", hret);
ok(hret == D3D_OK, "EndStateBlock returned %#x.\n", hret);
if (hret != D3D_OK) return EVENT_ERROR;
return EVENT_OK;
}
@ -365,7 +365,7 @@ static int apply_stateblock(
HRESULT hret;
hret = IDirect3DStateBlock9_Apply(edata->stateblock);
ok(hret == D3D_OK, "Apply returned %#lx.\n", hret);
ok(hret == D3D_OK, "Apply returned %#x.\n", hret);
if (hret != D3D_OK) {
IUnknown_Release(edata->stateblock);
return EVENT_ERROR;
@ -383,7 +383,7 @@ static int capture_stateblock(
event_data* edata = (event_data*) data;
hret = IDirect3DStateBlock9_Capture(edata->stateblock);
ok(hret == D3D_OK, "Capture returned %#lx.\n", hret);
ok(hret == D3D_OK, "Capture returned %#x.\n", hret);
if (hret != D3D_OK)
return EVENT_ERROR;
@ -519,19 +519,19 @@ static void shader_constant_set_handler(
if (!scarg->pshader) {
hret = IDirect3DDevice9_SetVertexShaderConstantI(device, index, scdata->int_constant, 1);
ok(hret == D3D_OK, "SetVertexShaderConstantI returned %#lx.\n", hret);
ok(hret == D3D_OK, "SetVertexShaderConstantI returned %#x.\n", hret);
hret = IDirect3DDevice9_SetVertexShaderConstantF(device, index, scdata->float_constant, 1);
ok(hret == D3D_OK, "SetVertexShaderConstantF returned %#lx.\n", hret);
ok(hret == D3D_OK, "SetVertexShaderConstantF returned %#x.\n", hret);
hret = IDirect3DDevice9_SetVertexShaderConstantB(device, index, scdata->bool_constant, 4);
ok(hret == D3D_OK, "SetVertexShaderConstantB returned %#lx.\n", hret);
ok(hret == D3D_OK, "SetVertexShaderConstantB returned %#x.\n", hret);
} else {
hret = IDirect3DDevice9_SetPixelShaderConstantI(device, index, scdata->int_constant, 1);
ok(hret == D3D_OK, "SetPixelShaderConstantI returned %#lx.\n", hret);
ok(hret == D3D_OK, "SetPixelShaderConstantI returned %#x.\n", hret);
hret = IDirect3DDevice9_SetPixelShaderConstantF(device, index, scdata->float_constant, 1);
ok(hret == D3D_OK, "SetPixelShaderConstantF returned %#lx.\n", hret);
ok(hret == D3D_OK, "SetPixelShaderConstantF returned %#x.\n", hret);
hret = IDirect3DDevice9_SetPixelShaderConstantB(device, index, scdata->bool_constant, 4);
ok(hret == D3D_OK, "SetPixelShaderConstantB returned %#lx.\n", hret);
ok(hret == D3D_OK, "SetPixelShaderConstantB returned %#x.\n", hret);
}
}
@ -545,19 +545,19 @@ static void shader_constant_get_handler(
if (!scarg->pshader) {
hret = IDirect3DDevice9_GetVertexShaderConstantI(device, index, scdata->int_constant, 1);
ok(hret == D3D_OK, "GetVertexShaderConstantI returned %#lx.\n", hret);
ok(hret == D3D_OK, "GetVertexShaderConstantI returned %#x.\n", hret);
hret = IDirect3DDevice9_GetVertexShaderConstantF(device, index, scdata->float_constant, 1);
ok(hret == D3D_OK, "GetVertexShaderConstantF returned %#lx.\n", hret);
ok(hret == D3D_OK, "GetVertexShaderConstantF returned %#x.\n", hret);
hret = IDirect3DDevice9_GetVertexShaderConstantB(device, index, scdata->bool_constant, 4);
ok(hret == D3D_OK, "GetVertexShaderConstantB returned %#lx.\n", hret);
ok(hret == D3D_OK, "GetVertexShaderConstantB returned %#x.\n", hret);
} else {
hret = IDirect3DDevice9_GetPixelShaderConstantI(device, index, scdata->int_constant, 1);
ok(hret == D3D_OK, "GetPixelShaderConstantI returned %#lx.\n", hret);
ok(hret == D3D_OK, "GetPixelShaderConstantI returned %#x.\n", hret);
hret = IDirect3DDevice9_GetPixelShaderConstantF(device, index, scdata->float_constant, 1);
ok(hret == D3D_OK, "GetPixelShaderConstantF returned %#lx.\n", hret);
ok(hret == D3D_OK, "GetPixelShaderConstantF returned %#x.\n", hret);
hret = IDirect3DDevice9_GetPixelShaderConstantB(device, index, scdata->bool_constant, 4);
ok(hret == D3D_OK, "GetPixelShaderConstantB returned %#lx.\n", hret);
ok(hret == D3D_OK, "GetPixelShaderConstantB returned %#x.\n", hret);
}
}
@ -637,8 +637,8 @@ static void light_print_handler(
const light_data* ldata = data;
trace("Get Light return value: %#lx\n", ldata->get_light_result);
trace("Get Light enable return value: %#lx\n", ldata->get_enabled_result);
trace("Get Light return value: %#x\n", ldata->get_light_result);
trace("Get Light enable return value: %#x\n", ldata->get_enabled_result);
trace("Light Enabled = %u\n", ldata->enabled);
trace("Light Type = %u\n", ldata->light.Type);
@ -673,10 +673,10 @@ static void light_set_handler(
unsigned int index = larg->idx;
hret = IDirect3DDevice9_SetLight(device, index, &ldata->light);
ok(hret == D3D_OK, "SetLight returned %#lx.\n", hret);
ok(hret == D3D_OK, "SetLight returned %#x.\n", hret);
hret = IDirect3DDevice9_LightEnable(device, index, ldata->enabled);
ok(hret == D3D_OK, "SetLightEnable returned %#lx.\n", hret);
ok(hret == D3D_OK, "SetLightEnable returned %#x.\n", hret);
}
static void light_get_handler(
@ -813,22 +813,22 @@ static void transform_set_handler(
const transform_data* tdata = data;
hret = IDirect3DDevice9_SetTransform(device, D3DTS_VIEW, &tdata->view);
ok(hret == D3D_OK, "SetTransform returned %#lx.\n", hret);
ok(hret == D3D_OK, "SetTransform returned %#x.\n", hret);
hret = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, &tdata->projection);
ok(hret == D3D_OK, "SetTransform returned %#lx.\n", hret);
ok(hret == D3D_OK, "SetTransform returned %#x.\n", hret);
hret = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, &tdata->texture0);
ok(hret == D3D_OK, "SetTransform returned %#lx.\n", hret);
ok(hret == D3D_OK, "SetTransform returned %#x.\n", hret);
hret = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0 + texture_stages - 1, &tdata->texture7);
ok(hret == D3D_OK, "SetTransform returned %#lx.\n", hret);
ok(hret == D3D_OK, "SetTransform returned %#x.\n", hret);
hret = IDirect3DDevice9_SetTransform(device, D3DTS_WORLD, &tdata->world0);
ok(hret == D3D_OK, "SetTransform returned %#lx.\n", hret);
ok(hret == D3D_OK, "SetTransform returned %#x.\n", hret);
hret = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(255), &tdata->world255);
ok(hret == D3D_OK, "SetTransform returned %#lx.\n", hret);
ok(hret == D3D_OK, "SetTransform returned %#x.\n", hret);
}
static void transform_get_handler(
@ -838,22 +838,22 @@ static void transform_get_handler(
transform_data* tdata = (transform_data*) data;
hret = IDirect3DDevice9_GetTransform(device, D3DTS_VIEW, &tdata->view);
ok(hret == D3D_OK, "GetTransform returned %#lx.\n", hret);
ok(hret == D3D_OK, "GetTransform returned %#x.\n", hret);
hret = IDirect3DDevice9_GetTransform(device, D3DTS_PROJECTION, &tdata->projection);
ok(hret == D3D_OK, "GetTransform returned %#lx.\n", hret);
ok(hret == D3D_OK, "GetTransform returned %#x.\n", hret);
hret = IDirect3DDevice9_GetTransform(device, D3DTS_TEXTURE0, &tdata->texture0);
ok(hret == D3D_OK, "GetTransform returned %#lx.\n", hret);
ok(hret == D3D_OK, "GetTransform returned %#x.\n", hret);
hret = IDirect3DDevice9_GetTransform(device, D3DTS_TEXTURE0 + texture_stages - 1, &tdata->texture7);
ok(hret == D3D_OK, "GetTransform returned %#lx.\n", hret);
ok(hret == D3D_OK, "GetTransform returned %#x.\n", hret);
hret = IDirect3DDevice9_GetTransform(device, D3DTS_WORLD, &tdata->world0);
ok(hret == D3D_OK, "GetTransform returned %#lx.\n", hret);
ok(hret == D3D_OK, "GetTransform returned %#x.\n", hret);
hret = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(255), &tdata->world255);
ok(hret == D3D_OK, "GetTransform returned %#lx.\n", hret);
ok(hret == D3D_OK, "GetTransform returned %#x.\n", hret);
}
static const transform_data transform_default_data = {
@ -1078,7 +1078,7 @@ static void render_state_set_handler(
for (i = 0; i < D3D9_RENDER_STATES; i++) {
hret = IDirect3DDevice9_SetRenderState(device, render_state_indices[i], rsdata->states[i]);
ok(hret == D3D_OK, "SetRenderState returned %#lx.\n", hret);
ok(hret == D3D_OK, "SetRenderState returned %#x.\n", hret);
}
}
@ -1091,7 +1091,7 @@ static void render_state_get_handler(
for (i = 0; i < D3D9_RENDER_STATES; i++) {
hret = IDirect3DDevice9_GetRenderState(device, render_state_indices[i], &rsdata->states[i]);
ok(hret == D3D_OK, "GetRenderState returned %#lx.\n", hret);
ok(hret == D3D_OK, "GetRenderState returned %#x.\n", hret);
}
}
@ -1102,7 +1102,7 @@ static void render_state_print_handler(
unsigned int i;
for (i = 0; i < D3D9_RENDER_STATES; i++)
trace("Index = %u, Value = %#lx\n", i, rsdata->states[i]);
trace("Index = %u, Value = %#x\n", i, rsdata->states[i]);
}
static inline DWORD to_dword(float fl) {
@ -1410,7 +1410,7 @@ static void test_state_management(
light_arg light_arg;
hret = IDirect3DDevice9_GetDeviceCaps(device, &caps);
ok(hret == D3D_OK, "GetDeviceCaps returned %#lx.\n", hret);
ok(hret == D3D_OK, "GetDeviceCaps returned %#x.\n", hret);
if (hret != D3D_OK) return;
texture_stages = caps.MaxTextureBlendStages;

View File

@ -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);

View File

@ -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 */

View File

@ -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.

View File

@ -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: