d3d8/tests: Fix test_ApplyStateBlock() (Valgrind).
This commit is contained in:
parent
93f1c49ea4
commit
3d64b44c8c
|
@ -2084,33 +2084,32 @@ static void test_ApplyStateBlock(void)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
IDirect3DDevice8_CreateStateBlock(device, D3DSBT_ALL, &token);
|
|
||||||
ok(token !=0, "received null token\n");
|
|
||||||
|
|
||||||
IDirect3DDevice8_BeginStateBlock(device);
|
IDirect3DDevice8_BeginStateBlock(device);
|
||||||
IDirect3DDevice8_SetRenderState(device, D3DRS_ZENABLE, TRUE);
|
IDirect3DDevice8_SetRenderState(device, D3DRS_ZENABLE, TRUE);
|
||||||
IDirect3DDevice8_EndStateBlock(device, &token);
|
IDirect3DDevice8_EndStateBlock(device, &token);
|
||||||
|
ok(token, "Received zero stateblock handle.\n");
|
||||||
IDirect3DDevice8_SetRenderState(device, D3DRS_ZENABLE, FALSE);
|
IDirect3DDevice8_SetRenderState(device, D3DRS_ZENABLE, FALSE);
|
||||||
|
|
||||||
hr = IDirect3DDevice8_GetRenderState(device, D3DRS_ZENABLE, &received);
|
hr = IDirect3DDevice8_GetRenderState(device, D3DRS_ZENABLE, &received);
|
||||||
ok(hr==D3D_OK, "Expected= D3D_OK, Got= %#x\n", hr);
|
ok(hr == D3D_OK, "Expected D3D_OK, received %#x.\n", hr);
|
||||||
ok(received==FALSE, "Expected = TRUE, received FALSE\n");
|
ok(!received, "Expected = FALSE, received TRUE.\n");
|
||||||
|
|
||||||
IDirect3DDevice8_ApplyStateBlock(device, 0);
|
IDirect3DDevice8_ApplyStateBlock(device, 0);
|
||||||
ok(hr == D3D_OK, "Expected= D3D_OK, Got= %#x\n", hr);
|
ok(hr == D3D_OK, "Expected D3D_OK, received %#x.\n", hr);
|
||||||
hr = IDirect3DDevice8_GetRenderState(device, D3DRS_ZENABLE, &received);
|
hr = IDirect3DDevice8_GetRenderState(device, D3DRS_ZENABLE, &received);
|
||||||
ok(hr==D3D_OK, "Expected= D3D_OK, Got= %#x\n", hr);
|
ok(hr == D3D_OK, "Expected D3D_OK, received %#x.\n", hr);
|
||||||
ok(received==FALSE, "Expected = TRUE, received FALSE\n");
|
ok(!received, "Expected FALSE, received TRUE.\n");
|
||||||
|
|
||||||
IDirect3DDevice8_ApplyStateBlock(device, token);
|
IDirect3DDevice8_ApplyStateBlock(device, token);
|
||||||
ok(hr == D3D_OK, "Expected= D3D_OK, Got= %#x\n", hr);
|
ok(hr == D3D_OK, "Expected D3D_OK, received %#x.\n", hr);
|
||||||
hr = IDirect3DDevice8_GetRenderState(device, D3DRS_ZENABLE, &received);
|
hr = IDirect3DDevice8_GetRenderState(device, D3DRS_ZENABLE, &received);
|
||||||
ok(hr==D3D_OK, "Expected= D3D_OK, Got= %#x\n", hr);
|
ok(hr == D3D_OK, "Expected D3D_OK, received %#x.\n", hr);
|
||||||
ok(received==TRUE, "Expected = TRUE, received FALSE\n");
|
ok(received, "Expected TRUE, received FALSE.\n");
|
||||||
|
|
||||||
cleanup:
|
IDirect3DDevice8_DeleteStateBlock(device, token);
|
||||||
if(device) IDirect3DDevice8_Release(device);
|
IDirect3DDevice8_Release(device);
|
||||||
if(d3d8) IDirect3D8_Release(d3d8);
|
cleanup:
|
||||||
|
if (d3d8) IDirect3D8_Release(d3d8);
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST(device)
|
START_TEST(device)
|
||||||
|
|
Loading…
Reference in New Issue