[PATCH] Test to know whether the top of a matrix stack is ALWAYS identity
Jérôme Gardou
jerome.gardou at laposte.net
Fri Oct 31 18:13:53 CDT 2008
---
dlls/d3dx8/tests/math.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c
index f38ff26..9f5207a 100644
--- a/dlls/d3dx8/tests/math.c
+++ b/dlls/d3dx8/tests/math.c
@@ -1442,7 +1442,7 @@ static void test_matrix_stack(void)
hr = ID3DXMatrixStack_LoadMatrix(stack, NULL);
ok(hr == D3DERR_INVALIDCALL, "LoadMatrix returned %#x, expected D3DERR_INVALIDCALL\n", hr);
-
+
hr = ID3DXMatrixStack_LoadMatrix(stack, &mat1);
ok(SUCCEEDED(hr), "LoadMatrix failed, hr %#x\n", hr);
expect_mat(&mat1, ID3DXMatrixStack_GetTop(stack));
@@ -1479,6 +1479,19 @@ static void test_matrix_stack(void)
ok(SUCCEEDED(hr), "Pop failed, hr %#x\n", hr);
ok(D3DXMatrixIsIdentity(ID3DXMatrixStack_GetTop(stack)), "The top should be an identity matrix\n");
+ hr = ID3DXMatrixStack_MultMatrix(stack, &mat2) ;
+ ok(SUCCEEDED(hr), "Multiplication failed");
+ /* Identity * mat2 = mat2 */
+ expect_mat(&mat2, ID3DXMatrixStack_GetTop(stack)) ;
+
+ hr = ID3DXMatrixStack_Push(stack);
+ ok(SUCCEEDED(hr), "Push failed, hr %#x\n", hr);
+
+ hr = ID3DXMatrixStack_Pop(stack);
+ ok(SUCCEEDED(hr), "Pop failed, hr %#x\n", hr);
+ /* here we are on the bottom of the stack... is it always identity? */
+ ok(D3DXMatrixIsIdentity(ID3DXMatrixStack_GetTop(stack)), "The top should be an identity matrix\n");
+
refcount = ID3DXMatrixStack_Release(stack);
ok(!refcount, "Matrix stack has %u references left.\n", refcount);
}
--
1.5.4.3
--------------030504010709040903020200--
More information about the wine-devel
mailing list