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
455edb18
Commit
455edb18
authored
Jan 13, 2012
by
André Hentschel
Committed by
Alexandre Julliard
Jan 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3drm: Add more MeshBuilder tests.
parent
59186dd4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
2 deletions
+97
-2
Makefile.in
dlls/d3drm/tests/Makefile.in
+1
-0
d3drm.c
dlls/d3drm/tests/d3drm.c
+96
-2
No files found.
dlls/d3drm/tests/Makefile.in
View file @
455edb18
TESTDLL
=
d3drm.dll
IMPORTS
=
dxguid
C_SRCS
=
\
d3drm.c
\
...
...
dlls/d3drm/tests/d3drm.c
View file @
455edb18
...
...
@@ -80,7 +80,7 @@ static char data_ok[] =
"3; 3, 1, 2;;
\n
"
"}
\n
"
;
static
void
MeshBuilderTest
(
void
)
static
void
test_MeshBuilder
(
void
)
{
HRESULT
hr
;
LPDIRECT3DRM
pD3DRM
;
...
...
@@ -88,6 +88,7 @@ static void MeshBuilderTest(void)
D3DRMLOADMEMORY
info
;
int
val
;
DWORD
val1
,
val2
,
val3
;
D3DVALUE
valu
,
valv
;
hr
=
pDirect3DRMCreate
(
&
pD3DRM
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get IDirect3DRM interface (hr = %x)
\n
"
,
hr
);
...
...
@@ -122,17 +123,110 @@ static void MeshBuilderTest(void)
todo_wine
ok
(
val2
==
4
,
"Wrong number of normals %d (must be 4)
\n
"
,
val2
);
todo_wine
ok
(
val3
==
22
,
"Wrong number of face data bytes %d (must be 22)
\n
"
,
val3
);
valu
=
1
.
23
f
;
valv
=
3
.
21
f
;
hr
=
IDirect3DRMMeshBuilder_GetTextureCoordinates
(
pMeshBuilder
,
1
,
&
valu
,
&
valv
);
todo_wine
ok
(
hr
==
D3DRM_OK
,
"Cannot get texture coordinates (hr = %x)
\n
"
,
hr
);
todo_wine
ok
(
valu
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valu
);
todo_wine
ok
(
valv
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valv
);
valu
=
1
.
23
f
;
valv
=
3
.
21
f
;
hr
=
IDirect3DRMMeshBuilder_SetTextureCoordinates
(
pMeshBuilder
,
1
,
valu
,
valv
);
todo_wine
ok
(
hr
==
D3DRM_OK
,
"Cannot set texture coordinates (hr = %x)
\n
"
,
hr
);
valu
=
0
.
0
f
;
valv
=
0
.
0
f
;
hr
=
IDirect3DRMMeshBuilder_GetTextureCoordinates
(
pMeshBuilder
,
1
,
&
valu
,
&
valv
);
todo_wine
ok
(
hr
==
D3DRM_OK
,
"Cannot get texture coordinates (hr = %x)
\n
"
,
hr
);
todo_wine
ok
(
valu
==
1
.
23
f
,
"Wrong coordinate %f (must be 1.23)
\n
"
,
valu
);
todo_wine
ok
(
valv
==
3
.
21
f
,
"Wrong coordinate %f (must be 3.21)
\n
"
,
valv
);
IDirect3DRMMeshBuilder_Release
(
pMeshBuilder
);
IDirect3DRM_Release
(
pD3DRM
);
}
static
void
test_MeshBuilder3
(
void
)
{
HRESULT
hr
;
LPDIRECT3DRM
pD3DRM
;
LPDIRECT3DRM3
pD3DRM3
;
LPDIRECT3DRMMESHBUILDER3
pMeshBuilder3
;
D3DRMLOADMEMORY
info
;
int
val
;
DWORD
val1
;
D3DVALUE
valu
,
valv
;
hr
=
pDirect3DRMCreate
(
&
pD3DRM
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get IDirect3DRM interface (hr = %x)
\n
"
,
hr
);
hr
=
IDirect3DRM_QueryInterface
(
pD3DRM
,
&
IID_IDirect3DRM3
,
(
LPVOID
*
)
&
pD3DRM3
);
if
(
FAILED
(
hr
))
{
win_skip
(
"Cannot get IDirect3DRM3 interface (hr = %x), skipping tests
\n
"
,
hr
);
return
;
}
hr
=
IDirect3DRM_CreateMeshBuilder
(
pD3DRM3
,
&
pMeshBuilder3
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get IDirect3DRMMeshBuilder3 interface (hr = %x)
\n
"
,
hr
);
info
.
lpMemory
=
data_bad_version
;
info
.
dSize
=
strlen
(
data_bad_version
);
hr
=
IDirect3DRMMeshBuilder_Load
(
pMeshBuilder3
,
&
info
,
NULL
,
D3DRMLOAD_FROMMEMORY
,
NULL
,
NULL
);
todo_wine
ok
(
hr
==
D3DRMERR_BADFILE
,
"Should have returned D3DRMERR_BADFILE (hr = %x)
\n
"
,
hr
);
info
.
lpMemory
=
data_no_mesh
;
info
.
dSize
=
strlen
(
data_no_mesh
);
hr
=
IDirect3DRMMeshBuilder_Load
(
pMeshBuilder3
,
&
info
,
NULL
,
D3DRMLOAD_FROMMEMORY
,
NULL
,
NULL
);
todo_wine
ok
(
hr
==
D3DRMERR_NOTFOUND
,
"Should have returned D3DRMERR_NOTFOUND (hr = %x)
\n
"
,
hr
);
info
.
lpMemory
=
data_ok
;
info
.
dSize
=
strlen
(
data_ok
);
hr
=
IDirect3DRMMeshBuilder_Load
(
pMeshBuilder3
,
&
info
,
NULL
,
D3DRMLOAD_FROMMEMORY
,
NULL
,
NULL
);
todo_wine
ok
(
hr
==
D3DRM_OK
,
"Cannot load mesh data (hr = %x)
\n
"
,
hr
);
val
=
IDirect3DRMMeshBuilder_GetVertexCount
(
pMeshBuilder3
);
todo_wine
ok
(
val
==
4
,
"Wrong number of vertices %d (must be 4)
\n
"
,
val
);
val
=
IDirect3DRMMeshBuilder_GetFaceCount
(
pMeshBuilder3
);
todo_wine
ok
(
val
==
3
,
"Wrong number of faces %d (must be 3)
\n
"
,
val
);
hr
=
IDirect3DRMMeshBuilder3_GetVertices
(
pMeshBuilder3
,
0
,
&
val1
,
NULL
);
todo_wine
ok
(
hr
==
D3DRM_OK
,
"Cannot get vertices information (hr = %x)
\n
"
,
hr
);
todo_wine
ok
(
val1
==
4
,
"Wrong number of vertices %d (must be 4)
\n
"
,
val1
);
valu
=
1
.
23
f
;
valv
=
3
.
21
f
;
hr
=
IDirect3DRMMeshBuilder3_GetTextureCoordinates
(
pMeshBuilder3
,
1
,
&
valu
,
&
valv
);
todo_wine
ok
(
hr
==
D3DRM_OK
,
"Cannot get texture coordinates (hr = %x)
\n
"
,
hr
);
todo_wine
ok
(
valu
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valu
);
todo_wine
ok
(
valv
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valv
);
valu
=
1
.
23
f
;
valv
=
3
.
21
f
;
hr
=
IDirect3DRMMeshBuilder3_SetTextureCoordinates
(
pMeshBuilder3
,
1
,
valu
,
valv
);
todo_wine
ok
(
hr
==
D3DRM_OK
,
"Cannot set texture coordinates (hr = %x)
\n
"
,
hr
);
valu
=
0
.
0
f
;
valv
=
0
.
0
f
;
hr
=
IDirect3DRMMeshBuilder3_GetTextureCoordinates
(
pMeshBuilder3
,
1
,
&
valu
,
&
valv
);
todo_wine
ok
(
hr
==
D3DRM_OK
,
"Cannot get texture coordinates (hr = %x)
\n
"
,
hr
);
todo_wine
ok
(
valu
==
1
.
23
f
,
"Wrong coordinate %f (must be 1.23)
\n
"
,
valu
);
todo_wine
ok
(
valv
==
3
.
21
f
,
"Wrong coordinate %f (must be 3.21)
\n
"
,
valv
);
IDirect3DRMMeshBuilder_Release
(
pMeshBuilder3
);
IDirect3DRM_Release
(
pD3DRM3
);
}
START_TEST
(
d3drm
)
{
if
(
!
InitFunctionPtrs
())
return
;
MeshBuilderTest
();
test_MeshBuilder
();
test_MeshBuilder3
();
FreeLibrary
(
d3drm_handle
);
}
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