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
71986eb1
Commit
71986eb1
authored
Jun 11, 2013
by
Christian Costa
Committed by
Alexandre Julliard
Jun 12, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dxof: Fix string handling in binary mode + tests.
parent
f92caf5b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
5 deletions
+23
-5
parsing.c
dlls/d3dxof/parsing.c
+0
-5
d3dxof.c
dlls/d3dxof/tests/d3dxof.c
+23
-0
No files found.
dlls/d3dxof/parsing.c
View file @
71986eb1
...
...
@@ -811,7 +811,6 @@ static WORD parse_TOKEN(parse_buffer * buf)
case
TOKEN_STRING
:
{
DWORD
count
;
WORD
tmp_token
;
char
*
string
=
(
char
*
)
buf
->
value
;
if
(
!
read_bytes
(
buf
,
&
count
,
4
))
...
...
@@ -819,10 +818,6 @@ static WORD parse_TOKEN(parse_buffer * buf)
if
(
!
read_bytes
(
buf
,
string
,
count
))
return
TOKEN_ERROR
;
string
[
count
]
=
0
;
if
(
!
read_bytes
(
buf
,
&
tmp_token
,
2
))
return
TOKEN_ERROR
;
if
((
tmp_token
!=
TOKEN_COMMA
)
&&
(
tmp_token
!=
TOKEN_SEMICOLON
))
ERR
(
"No comma or semicolon (got %d)
\n
"
,
tmp_token
);
TRACE
(
"string = %s
\n
"
,
string
);
token
=
TOKEN_LPSTR
;
...
...
dlls/d3dxof/tests/d3dxof.c
View file @
71986eb1
...
...
@@ -30,6 +30,7 @@
#define I4(x) x,0,0,0
#define TOKEN_NAME I2(1)
#define TOKEN_STRING I2(2)
#define TOKEN_INTEGER I2(3)
#define TOKEN_INTEGER_LIST I2(6)
#define TOKEN_OBRACE I2(10)
...
...
@@ -328,6 +329,13 @@ static char object_syntax_string_with_separator[] =
"
\"
foo;bar
\"
;
\n
"
"}
\n
"
;
static
char
object_syntax_string_bin
[]
=
{
'x'
,
'o'
,
'f'
,
' '
,
'0'
,
'3'
,
'0'
,
'2'
,
'b'
,
'i'
,
'n'
,
' '
,
'0'
,
'0'
,
'6'
,
'4'
,
TOKEN_NAME
,
/* size */
I4
(
8
),
/* name */
'F'
,
'i'
,
'l'
,
'e'
,
'n'
,
'a'
,
'm'
,
'e'
,
TOKEN_OBRACE
,
TOKEN_STRING
,
/* size */
I4
(
6
),
/* string */
'f'
,
'o'
,
'o'
,
'b'
,
'a'
,
'r'
,
TOKEN_SEMICOLON
,
TOKEN_CBRACE
};
static
char
templates_complex_object
[]
=
"xof 0302txt 0064
\n
"
"template Vector
\n
"
...
...
@@ -850,6 +858,21 @@ static void test_syntax(void)
IDirectXFileData_Release
(
lpdxfd
);
IDirectXFileEnumObject_Release
(
lpdxfeo
);
/* Test string in binary mode */
dxflm
.
lpMemory
=
&
object_syntax_string_bin
;
dxflm
.
dSize
=
sizeof
(
object_syntax_string_bin
);
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
);
hr
=
IDirectXFileData_GetData
(
lpdxfd
,
NULL
,
&
size
,
(
void
**
)
&
string
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileData_GetData: %x
\n
"
,
hr
);
ok
(
size
==
sizeof
(
char
*
),
"Got wrong data size %d
\n
"
,
size
);
ok
(
!
strcmp
(
*
string
,
"foobar"
),
"Got string %s, expected foobar
\n
"
,
*
string
);
if
(
hr
==
DXFILE_OK
)
IDirectXFileData_Release
(
lpdxfd
);
IDirectXFileEnumObject_Release
(
lpdxfeo
);
IDirectXFile_Release
(
lpDirectXFile
);
}
...
...
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