[PATCH 2/5] d3dx9/tests: Clean up test_update_semantics() a bit.
Matteo Bruni
mbruni at codeweavers.com
Fri Nov 19 13:50:27 CST 2021
Inspired by a patch from Eric Pouech <eric.pouech at gmail.com>.
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
dlls/d3dx9_36/tests/mesh.c | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c
index 829e4ee0ff9..3274b2d38bc 100644
--- a/dlls/d3dx9_36/tests/mesh.c
+++ b/dlls/d3dx9_36/tests/mesh.c
@@ -4739,11 +4739,9 @@ static void test_update_semantics(void)
D3DVERTEXELEMENT9 *decl_ptr;
DWORD exp_vertex_size = sizeof(*vertices);
DWORD vertex_size = 0;
+ BYTE *decl_mem;
int equal;
int i = 0;
- int *decl_mem;
- int filler_a = 0xaaaaaaaa;
- int filler_b = 0xbbbbbbbb;
test_context = new_test_context();
if (!test_context)
@@ -4815,22 +4813,20 @@ static void test_update_semantics(void)
/* Check that GetDeclaration only writes up to the D3DDECL_END() marker and
* not the full MAX_FVF_DECL_SIZE elements.
*/
- memset(declaration, filler_a, sizeof(declaration));
+ memset(declaration, 0xaa, sizeof(declaration));
memcpy(declaration, declaration0, sizeof(declaration0));
hr = mesh->lpVtbl->UpdateSemantics(mesh, declaration);
ok(hr == D3D_OK, "Test UpdateSemantics, "
"got %#x expected D3D_OK\n", hr);
- memset(declaration, filler_b, sizeof(declaration));
+ memset(declaration, 0xbb, sizeof(declaration));
hr = mesh->lpVtbl->GetDeclaration(mesh, declaration);
ok(hr == D3D_OK, "Couldn't get vertex declaration. Got %#x, expected D3D_OK\n", hr);
- decl_mem = (int*)declaration;
- for (i = sizeof(declaration0)/sizeof(*decl_mem); i < sizeof(declaration)/sizeof(*decl_mem); i++)
- {
- equal = memcmp(&decl_mem[i], &filler_b, sizeof(filler_b));
- ok(equal == 0,
- "GetDeclaration wrote past the D3DDECL_END() marker. "
- "Got %#x, expected %#x\n", decl_mem[i], filler_b);
- if (equal != 0) break;
+ decl_mem = (BYTE *)declaration;
+ for (i = sizeof(declaration0); i < sizeof(declaration); ++i)
+ {
+ ok(decl_mem[i] == 0xbb, "Unexpected %#x.\n", decl_mem[i]);
+ if (equal != 0)
+ break;
}
/* UpdateSemantics does not check for overlapping fields */
--
2.26.3
More information about the wine-devel
mailing list