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
07931f73
Commit
07931f73
authored
Feb 19, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Feb 20, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dxof: Fix parsing of empty array + tests.
parent
ddecb6aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
1 deletion
+65
-1
parsing.c
dlls/d3dxof/parsing.c
+1
-1
d3dxof.c
dlls/d3dxof/tests/d3dxof.c
+64
-0
No files found.
dlls/d3dxof/parsing.c
View file @
07931f73
...
@@ -1315,7 +1315,7 @@ static BOOL parse_object_members_list(parse_buffer * buf)
...
@@ -1315,7 +1315,7 @@ static BOOL parse_object_members_list(parse_buffer * buf)
}
}
}
}
if
(
nb_elems
&&
buf
->
txt
&&
(
check_TOKEN
(
buf
)
!=
TOKEN_CBRACE
)
&&
(
check_TOKEN
(
buf
)
!=
TOKEN_NAME
))
if
(
buf
->
txt
&&
(
check_TOKEN
(
buf
)
!=
TOKEN_CBRACE
)
&&
(
check_TOKEN
(
buf
)
!=
TOKEN_NAME
))
{
{
token
=
get_TOKEN
(
buf
);
token
=
get_TOKEN
(
buf
);
if
((
token
!=
TOKEN_SEMICOLON
)
&&
(
token
!=
TOKEN_COMMA
))
if
((
token
!=
TOKEN_SEMICOLON
)
&&
(
token
!=
TOKEN_COMMA
))
...
...
dlls/d3dxof/tests/d3dxof.c
View file @
07931f73
...
@@ -91,6 +91,25 @@ static char object_noname[] =
...
@@ -91,6 +91,25 @@ static char object_noname[] =
"1; 2; 3;
\n
"
"1; 2; 3;
\n
"
"}
\n
"
;
"}
\n
"
;
static
char
template_syntax_empty_array
[]
=
"xof 0302txt 0064
\n
"
"template Buffer
\n
"
"{
\n
"
"<3D82AB43-62DA-11CF-AB39-0020AF71E433>
\n
"
"DWORD num_elem;
\n
"
"array DWORD value[num_elem];
\n
"
"DWORD dummy;
\n
"
"}
\n
"
;
static
char
object_syntax_empty_array
[]
=
"xof 0302txt 0064
\n
"
"Buffer
\n
"
"{
\n
"
"0;
\n
"
";
\n
"
"1234;
\n
"
"}
\n
"
;
static
void
init_function_pointers
(
void
)
static
void
init_function_pointers
(
void
)
{
{
/* We have to use LoadLibrary as no d3dxof functions are referenced directly */
/* We have to use LoadLibrary as no d3dxof functions are referenced directly */
...
@@ -457,6 +476,50 @@ static void test_getname(void)
...
@@ -457,6 +476,50 @@ static void test_getname(void)
ok
(
ref
==
0
,
"Got refcount %d, expected 0
\n
"
,
ref
);
ok
(
ref
==
0
,
"Got refcount %d, expected 0
\n
"
,
ref
);
}
}
static
void
test_syntax
(
void
)
{
HRESULT
hr
;
ULONG
ref
;
LPDIRECTXFILE
lpDirectXFile
=
NULL
;
LPDIRECTXFILEENUMOBJECT
lpdxfeo
;
LPDIRECTXFILEDATA
lpdxfd
;
DXFILELOADMEMORY
dxflm
;
if
(
!
pDirectXFileCreate
)
{
win_skip
(
"DirectXFileCreate is not available
\n
"
);
return
;
}
hr
=
pDirectXFileCreate
(
&
lpDirectXFile
);
ok
(
hr
==
DXFILE_OK
,
"DirectXFileCreate: %x
\n
"
,
hr
);
if
(
!
lpDirectXFile
)
{
skip
(
"Couldn't create DirectXFile interface
\n
"
);
return
;
}
hr
=
IDirectXFile_RegisterTemplates
(
lpDirectXFile
,
template_syntax_empty_array
,
sizeof
(
template_syntax_empty_array
)
-
1
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileImpl_RegisterTemplates: %x
\n
"
,
hr
);
dxflm
.
lpMemory
=
&
object_syntax_empty_array
;
dxflm
.
dSize
=
sizeof
(
object_syntax_empty_array
)
-
1
;
hr
=
IDirectXFile_CreateEnumObject
(
lpDirectXFile
,
&
dxflm
,
DXFILELOAD_FROMMEMORY
,
&
lpdxfeo
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFile_CreateEnumObject: %x
\n
"
,
hr
);
hr
=
IDirectXFileEnumObject_GetNextDataObject
(
lpdxfeo
,
&
lpdxfd
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileEnumObject_GetNextDataObject: %x
\n
"
,
hr
);
ref
=
IDirectXFileEnumObject_Release
(
lpdxfeo
);
ok
(
ref
==
0
,
"Got refcount %d, expected 0
\n
"
,
ref
);
if
(
hr
==
DXFILE_OK
)
{
ref
=
IDirectXFileData_Release
(
lpdxfd
);
ok
(
ref
==
0
,
"Got refcount %d, expected 0
\n
"
,
ref
);
}
ref
=
IDirectXFile_Release
(
lpDirectXFile
);
ok
(
ref
==
0
,
"Got refcount %d, expected 0
\n
"
,
ref
);
}
/* Set it to 1 to expand the string when dumping the object. This is useful when there is
/* 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. */
* only one string in a sub-object (very common). Use with care, this may lead to a crash. */
#define EXPAND_STRING 0
#define EXPAND_STRING 0
...
@@ -634,6 +697,7 @@ START_TEST(d3dxof)
...
@@ -634,6 +697,7 @@ START_TEST(d3dxof)
test_file_types
();
test_file_types
();
test_compressed_files
();
test_compressed_files
();
test_getname
();
test_getname
();
test_syntax
();
test_dump
();
test_dump
();
FreeLibrary
(
hd3dxof
);
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