Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
5302d2b3
Commit
5302d2b3
authored
Oct 30, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 31, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Add a few tests for ID3DXMatrixStack.
parent
bbc2f7d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
0 deletions
+81
-0
math.c
dlls/d3dx8/tests/math.c
+81
-0
No files found.
dlls/d3dx8/tests/math.c
View file @
5302d2b3
...
...
@@ -1403,6 +1403,86 @@ static void D3X8Vector4Test(void)
expect_vec4
(
expectedtrans
,
gottrans
);
}
static
void
test_matrix_stack
(
void
)
{
ID3DXMatrixStack
*
stack
;
ULONG
refcount
;
HRESULT
hr
;
const
D3DXMATRIX
mat1
=
{{{
1
.
0
f
,
2
.
0
f
,
3
.
0
f
,
4
.
0
f
,
5
.
0
f
,
6
.
0
f
,
7
.
0
f
,
8
.
0
f
,
9
.
0
f
,
10
.
0
f
,
11
.
0
f
,
12
.
0
f
,
13
.
0
f
,
14
.
0
f
,
15
.
0
f
,
16
.
0
f
}}};
const
D3DXMATRIX
mat2
=
{{{
17
.
0
f
,
18
.
0
f
,
19
.
0
f
,
20
.
0
f
,
21
.
0
f
,
22
.
0
f
,
23
.
0
f
,
24
.
0
f
,
25
.
0
f
,
26
.
0
f
,
27
.
0
f
,
28
.
0
f
,
29
.
0
f
,
30
.
0
f
,
31
.
0
f
,
32
.
0
f
}}};
hr
=
D3DXCreateMatrixStack
(
0
,
&
stack
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create a matrix stack, hr %#x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
ok
(
D3DXMatrixIsIdentity
(
ID3DXMatrixStack_GetTop
(
stack
)),
"The top of an empty matrix stack should be an identity matrix
\n
"
);
hr
=
ID3DXMatrixStack_Pop
(
stack
);
ok
(
SUCCEEDED
(
hr
),
"Pop failed, hr %#x
\n
"
,
hr
);
hr
=
ID3DXMatrixStack_Push
(
stack
);
ok
(
SUCCEEDED
(
hr
),
"Push failed, hr %#x
\n
"
,
hr
);
ok
(
D3DXMatrixIsIdentity
(
ID3DXMatrixStack_GetTop
(
stack
)),
"The top should be an identity matrix
\n
"
);
hr
=
ID3DXMatrixStack_Push
(
stack
);
ok
(
SUCCEEDED
(
hr
),
"Push failed, hr %#x
\n
"
,
hr
);
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
));
hr
=
ID3DXMatrixStack_Push
(
stack
);
ok
(
SUCCEEDED
(
hr
),
"Push failed, hr %#x
\n
"
,
hr
);
expect_mat
(
&
mat1
,
ID3DXMatrixStack_GetTop
(
stack
));
hr
=
ID3DXMatrixStack_LoadMatrix
(
stack
,
&
mat2
);
ok
(
SUCCEEDED
(
hr
),
"LoadMatrix failed, hr %#x
\n
"
,
hr
);
expect_mat
(
&
mat2
,
ID3DXMatrixStack_GetTop
(
stack
));
hr
=
ID3DXMatrixStack_Push
(
stack
);
ok
(
SUCCEEDED
(
hr
),
"Push failed, hr %#x
\n
"
,
hr
);
expect_mat
(
&
mat2
,
ID3DXMatrixStack_GetTop
(
stack
));
hr
=
ID3DXMatrixStack_LoadIdentity
(
stack
);
ok
(
SUCCEEDED
(
hr
),
"LoadIdentity failed, hr %#x
\n
"
,
hr
);
ok
(
D3DXMatrixIsIdentity
(
ID3DXMatrixStack_GetTop
(
stack
)),
"The top should be an identity matrix
\n
"
);
hr
=
ID3DXMatrixStack_Pop
(
stack
);
ok
(
SUCCEEDED
(
hr
),
"Pop failed, hr %#x
\n
"
,
hr
);
expect_mat
(
&
mat2
,
ID3DXMatrixStack_GetTop
(
stack
));
hr
=
ID3DXMatrixStack_Pop
(
stack
);
ok
(
SUCCEEDED
(
hr
),
"Pop failed, hr %#x
\n
"
,
hr
);
expect_mat
(
&
mat1
,
ID3DXMatrixStack_GetTop
(
stack
));
hr
=
ID3DXMatrixStack_Pop
(
stack
);
ok
(
SUCCEEDED
(
hr
),
"Pop failed, hr %#x
\n
"
,
hr
);
ok
(
D3DXMatrixIsIdentity
(
ID3DXMatrixStack_GetTop
(
stack
)),
"The top should be an identity matrix
\n
"
);
hr
=
ID3DXMatrixStack_Pop
(
stack
);
ok
(
SUCCEEDED
(
hr
),
"Pop failed, hr %#x
\n
"
,
hr
);
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
);
}
START_TEST
(
math
)
{
D3DXColorTest
();
...
...
@@ -1412,4 +1492,5 @@ START_TEST(math)
D3X8Vector2Test
();
D3X8Vector3Test
();
D3X8Vector4Test
();
test_matrix_stack
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment