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
65d7a8b3
Commit
65d7a8b3
authored
Jun 06, 2013
by
Christian Costa
Committed by
Alexandre Julliard
Jun 07, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dxof: Add test for more complex object.
parent
ad008e22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
0 deletions
+77
-0
d3dxof.c
dlls/d3dxof/tests/d3dxof.c
+77
-0
No files found.
dlls/d3dxof/tests/d3dxof.c
View file @
65d7a8b3
...
...
@@ -327,6 +327,46 @@ static char object_syntax_string_with_separator[] =
"
\"
foo;bar
\"
;
\n
"
"}
\n
"
;
static
char
templates_complex_object
[]
=
"xof 0302txt 0064
\n
"
"template Vector
\n
"
"{
\n
"
"<3D82AB5E-62DA-11CF-AB39-0020AF71E433>
\n
"
"FLOAT x;
\n
"
"FLOAT y;
\n
"
"FLOAT z;
\n
"
"}
\n
"
"template MeshFace
\n
"
"{
\n
"
"<3D82AB5F-62DA-11CF-AB39-0020AF71E433>
\n
"
"DWORD nFaceVertexIndices;
\n
"
"array DWORD faceVertexIndices[nFaceVertexIndices];
\n
"
"}
\n
"
"template Mesh
\n
"
"{
\n
"
"<3D82AB44-62DA-11CF-AB39-0020AF71E433>
\n
"
"DWORD nVertices;
\n
"
"array Vector vertices[nVertices];
\n
"
"DWORD nFaces;
\n
"
"array MeshFace faces[nFaces];
\n
"
"[...]
\n
"
"}
\n
"
;
static
char
object_complex
[]
=
"xof 0302txt 0064
\n
"
"Mesh Object
\n
"
"{
\n
"
"4;;;,
\n
"
"1.0;;;, 0.0;;;, 0.0;;;,
\n
"
"0.0;;;, 1.0;;;, 0.0;;;,
\n
"
"0.0;;;, 0.0;;;, 1.0;;;,
\n
"
"1.0;;;, 1.0;;;, 1.0;;;,
\n
"
"3;;;,
\n
"
"3;;;, 0;;;, 1;;;, 2;;;,
\n
"
"3;;;, 1;;;, 2;;;, 3;;;,
\n
"
"3;;;, 3;;;, 1;;;, 2;;;,
\n
"
"}
\n
"
;
static
void
init_function_pointers
(
void
)
{
/* We have to use LoadLibrary as no d3dxof functions are referenced directly */
...
...
@@ -938,6 +978,42 @@ static void test_syntax_semicolon_comma(void)
IDirectXFile_Release
(
dxfile
);
}
static
void
test_complex_object
(
void
)
{
HRESULT
ret
;
IDirectXFile
*
dxfile
=
NULL
;
IDirectXFileEnumObject
*
enum_object
;
IDirectXFileData
*
file_data
;
DXFILELOADMEMORY
load_info
;
if
(
!
pDirectXFileCreate
)
{
win_skip
(
"DirectXFileCreate is not available
\n
"
);
return
;
}
ret
=
pDirectXFileCreate
(
&
dxfile
);
ok
(
ret
==
DXFILE_OK
,
"DirectXFileCreate failed with %#x
\n
"
,
ret
);
if
(
!
dxfile
)
{
skip
(
"Couldn't create DirectXFile interface
\n
"
);
return
;
}
ret
=
IDirectXFile_RegisterTemplates
(
dxfile
,
templates_complex_object
,
sizeof
(
templates_complex_object
)
-
1
);
ok
(
ret
==
DXFILE_OK
,
"IDirectXFileImpl_RegisterTemplates failed with %#x
\n
"
,
ret
);
load_info
.
lpMemory
=
object_complex
;
load_info
.
dSize
=
sizeof
(
object_complex
)
-
1
;
ret
=
IDirectXFile_CreateEnumObject
(
dxfile
,
&
load_info
,
DXFILELOAD_FROMMEMORY
,
&
enum_object
);
ok
(
ret
==
DXFILE_OK
,
"IDirectXFile_CreateEnumObject failed with %#x
\n
"
,
ret
);
ret
=
IDirectXFileEnumObject_GetNextDataObject
(
enum_object
,
&
file_data
);
ok
(
ret
==
DXFILE_OK
,
"IDirectXFileEnumObject_GetNextDataObject failed with %#x
\n
"
,
ret
);
IDirectXFileData_Release
(
file_data
);
IDirectXFileEnumObject_Release
(
enum_object
);
IDirectXFile_Release
(
dxfile
);
}
/* Set it to 1 to expand the string when dumping the object. This is useful when there is
* only one string in a sub-object (very common). Use with care, this may lead to a crash. */
#define EXPAND_STRING 0
...
...
@@ -1122,6 +1198,7 @@ START_TEST(d3dxof)
test_getname
();
test_syntax
();
test_syntax_semicolon_comma
();
test_complex_object
();
test_dump
();
FreeLibrary
(
hd3dxof
);
...
...
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