d3drm/tests: Release the material after a GetGroupMaterial() call in test_MeshBuilder() (Valgrind).

This commit is contained in:
Henri Verbeet 2015-05-04 13:21:32 +02:00 committed by Alexandre Julliard
parent e723d2a079
commit e2e1ac2bf6
1 changed files with 13 additions and 15 deletions

View File

@ -447,21 +447,19 @@ static void test_MeshBuilder(void)
hr = IDirect3DRMMesh_GetGroupMaterial(mesh, 0, &material); hr = IDirect3DRMMesh_GetGroupMaterial(mesh, 0, &material);
ok(hr == D3DRM_OK, "GetCroupMaterial failed returning hr = %x\n", hr); ok(hr == D3DRM_OK, "GetCroupMaterial failed returning hr = %x\n", hr);
ok(material != NULL, "No material present\n"); ok(material != NULL, "No material present\n");
if ((hr == D3DRM_OK) && material) hr = IDirect3DRMMaterial_GetEmissive(material, &values[0], &values[1], &values[2]);
{ ok(hr == D3DRM_OK, "Failed to get emissive color, hr %#x.\n", hr);
hr = IDirect3DRMMaterial_GetEmissive(material, &values[0], &values[1], &values[2]); ok(values[0] == 0.5f, "Got unexpected red component %.8e.\n", values[0]);
ok(hr == D3DRM_OK, "GetMaterialEmissive failed returning hr = %x\n", hr); ok(values[1] == 0.5f, "Got unexpected green component %.8e.\n", values[1]);
ok(values[0] == 0.5f, "Emissive red component should be %f instead of %f\n", 0.5f, values[0]); ok(values[2] == 0.5f, "Got unexpected blue component %.8e.\n", values[2]);
ok(values[1] == 0.5f, "Emissive green component should be %f instead of %f\n", 0.5f, values[1]); hr = IDirect3DRMMaterial_GetSpecular(material, &values[0], &values[1], &values[2]);
ok(values[2] == 0.5f, "Emissive blue component should be %f instead of %f\n", 0.5f, values[2]); ok(hr == D3DRM_OK, "Failed to get specular color, hr %#x.\n", hr);
hr = IDirect3DRMMaterial_GetSpecular(material, &values[0], &values[1], &values[2]); ok(values[0] == 1.0f, "Got unexpected red component %.8e.\n", values[0]);
ok(hr == D3DRM_OK, "GetMaterialEmissive failed returning hr = %x\n", hr); ok(values[1] == 0.0f, "Got unexpected green component %.8e.\n", values[1]);
ok(values[0] == 1.0f, "Specular red component should be %f instead of %f\n", 1.0f, values[0]); ok(values[2] == 0.0f, "Got unexpected blue component %.8e.\n", values[2]);
ok(values[1] == 0.0f, "Specular green component should be %f instead of %f\n", 0.0f, values[1]); values[0] = IDirect3DRMMaterial_GetPower(material);
ok(values[2] == 0.0f, "Specular blue component should be %f instead of %f\n", 0.0f, values[2]); ok(values[0] == 30.0f, "Got unexpected power value %.8e.\n", values[0]);
values[0] = IDirect3DRMMaterial_GetPower(material); IDirect3DRMMaterial_Release(material);
ok(values[0] == 30.0f, "Power value should be %f instead of %f\n", 30.0f, values[0]);
}
IDirect3DRMMesh_Release(mesh); IDirect3DRMMesh_Release(mesh);
} }