Commit 526909f8 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

d3dx9/tests: Get rid of unnecessary branches in D3DXLoadMeshTest().

parent e4cdcb1e
......@@ -2383,6 +2383,8 @@ static void D3DXLoadMeshTest(void)
D3DXMATRIX transform;
struct test_context *test_context;
ID3DXAnimationController *controller;
D3DXMESHCONTAINER *container;
unsigned int i;
if (!(test_context = new_test_context()))
{
......@@ -2418,8 +2420,7 @@ static void D3DXLoadMeshTest(void)
hr = D3DXLoadMeshHierarchyFromXInMemory(simple_xfile, sizeof(simple_xfile) - 1,
D3DXMESH_MANAGED, device, &alloc_hier, NULL, &frame_hier, NULL);
ok(hr == D3D_OK, "Expected D3D_OK, got %#lx\n", hr);
if (SUCCEEDED(hr)) {
D3DXMESHCONTAINER *container = frame_hier->pMeshContainer;
container = frame_hier->pMeshContainer;
ok(frame_hier->Name == NULL, "Expected NULL, got '%s'\n", frame_hier->Name);
D3DXMatrixIdentity(&transform);
......@@ -2437,7 +2438,6 @@ static void D3DXLoadMeshTest(void)
hr = D3DXFrameDestroy(frame_hier, &alloc_hier);
ok(hr == D3D_OK, "Expected D3D_OK, got %#lx\n", hr);
frame_hier = NULL;
}
controller = (ID3DXAnimationController *)0xdeadbeef;
hr = D3DXLoadMeshHierarchyFromXInMemory(box_anim_xfile, sizeof(box_anim_xfile) - 1,
......@@ -2459,9 +2459,7 @@ static void D3DXLoadMeshTest(void)
hr = D3DXLoadMeshHierarchyFromXInMemory(box_xfile, sizeof(box_xfile) - 1,
D3DXMESH_MANAGED, device, &alloc_hier, NULL, &frame_hier, &controller);
ok(hr == D3D_OK, "Expected D3D_OK, got %#lx\n", hr);
if (SUCCEEDED(hr))
{
D3DXMESHCONTAINER *container = frame_hier->pMeshContainer;
container = frame_hier->pMeshContainer;
ok(!controller, "Animation Controller returned.\n");
ok(frame_hier->Name == NULL, "Expected NULL, got '%s'\n", frame_hier->Name);
......@@ -2480,14 +2478,11 @@ static void D3DXLoadMeshTest(void)
hr = D3DXFrameDestroy(frame_hier, &alloc_hier);
ok(hr == D3D_OK, "Expected D3D_OK, got %#lx\n", hr);
frame_hier = NULL;
}
hr = D3DXLoadMeshHierarchyFromXInMemory(framed_xfile, sizeof(framed_xfile) - 1,
D3DXMESH_MANAGED, device, &alloc_hier, NULL, &frame_hier, NULL);
ok(hr == D3D_OK, "Expected D3D_OK, got %#lx\n", hr);
if (SUCCEEDED(hr)) {
D3DXMESHCONTAINER *container = frame_hier->pMeshContainer;
int i;
container = frame_hier->pMeshContainer;
ok(!strcmp(frame_hier->Name, ""), "Expected '', got '%s'\n", frame_hier->Name);
/* last frame transform replaces the first */
......@@ -2495,7 +2490,8 @@ static void D3DXLoadMeshTest(void)
transform.m[3][2] = 3.0;
check_matrix(&frame_hier->TransformationMatrix, &transform);
for (i = 0; i < 3; i++) {
for (i = 0; i < 3; ++i)
{
ok(!strcmp(container->Name, ""), "Expected '', got '%s'\n", container->Name);
ok(container->MeshData.Type == D3DXMESHTYPE_MESH, "Expected %d, got %d\n",
D3DXMESHTYPE_MESH, container->MeshData.Type);
......@@ -2511,7 +2507,6 @@ static void D3DXLoadMeshTest(void)
hr = D3DXFrameDestroy(frame_hier, &alloc_hier);
ok(hr == D3D_OK, "Expected D3D_OK, got %#lx\n", hr);
frame_hier = NULL;
}
hr = D3DXLoadMeshFromXInMemory(NULL, 0, D3DXMESH_MANAGED,
......@@ -2541,7 +2536,6 @@ static void D3DXLoadMeshTest(void)
hr = D3DXLoadMeshFromXInMemory(simple_xfile, sizeof(simple_xfile) - 1, D3DXMESH_MANAGED,
device, NULL, NULL, NULL, NULL, &mesh);
ok(hr == D3D_OK, "Expected D3D_OK, got %#lx\n", hr);
if (SUCCEEDED(hr))
IUnknown_Release(mesh);
test_LoadMeshFromX(device, simple_xfile, simple_vertex_buffer, simple_fvf, simple_index_buffer, default_materials, TRUE);
......
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