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
b26b2655
Commit
b26b2655
authored
Oct 12, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: WS_FIELD_OPTIONAL takes precedence over WS_FIELD_NILLABLE.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b2fe6757
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
writer.c
dlls/webservices/tests/writer.c
+15
-5
writer.c
dlls/webservices/writer.c
+2
-5
No files found.
dlls/webservices/tests/writer.c
View file @
b26b2655
...
...
@@ -2122,7 +2122,7 @@ static void test_double(void)
WsFreeWriter
(
writer
);
}
static
void
test_field_
flag
s
(
void
)
static
void
test_field_
option
s
(
void
)
{
static
const
char
expected
[]
=
"<t><bool a:nil=
\"
true
\"
xmlns:a=
\"
http://www.w3.org/2001/XMLSchema-instance
\"
/><int32>-1</int32>"
...
...
@@ -2130,10 +2130,10 @@ static void test_field_flags(void)
HRESULT
hr
;
WS_XML_WRITER
*
writer
;
WS_STRUCT_DESCRIPTION
s
;
WS_FIELD_DESCRIPTION
f
,
f2
,
f3
,
f4
,
*
fields
[
4
];
WS_FIELD_DESCRIPTION
f
,
f2
,
f3
,
f4
,
f5
,
*
fields
[
5
];
WS_XML_STRING
localname
=
{
1
,
(
BYTE
*
)
"t"
},
ns
=
{
0
,
NULL
},
str_guid
=
{
4
,
(
BYTE
*
)
"guid"
};
WS_XML_STRING
str_int32
=
{
5
,
(
BYTE
*
)
"int32"
},
str_bool
=
{
4
,
(
BYTE
*
)
"bool"
};
WS_XML_STRING
str_xmlstr
=
{
6
,
(
BYTE
*
)
"xmlstr"
};
WS_XML_STRING
str_xmlstr
=
{
6
,
(
BYTE
*
)
"xmlstr"
}
,
str_str
=
{
3
,
(
BYTE
*
)
"str"
}
;
INT32
val
=
-
1
;
struct
test
{
...
...
@@ -2141,6 +2141,7 @@ static void test_field_flags(void)
BOOL
*
bool_ptr
;
INT32
*
int32_ptr
;
WS_XML_STRING
xmlstr
;
WCHAR
*
str
;
}
test
;
hr
=
WsCreateWriter
(
NULL
,
0
,
&
writer
,
NULL
);
...
...
@@ -2187,11 +2188,20 @@ static void test_field_flags(void)
f4
.
options
=
WS_FIELD_NILLABLE
;
fields
[
3
]
=
&
f4
;
memset
(
&
f5
,
0
,
sizeof
(
f5
)
);
f5
.
mapping
=
WS_ELEMENT_FIELD_MAPPING
;
f5
.
localName
=
&
str_str
;
f5
.
offset
=
FIELD_OFFSET
(
struct
test
,
str
);
f5
.
ns
=
&
ns
;
f5
.
type
=
WS_WSZ_TYPE
;
f5
.
options
=
WS_FIELD_OPTIONAL
|
WS_FIELD_NILLABLE
;
fields
[
4
]
=
&
f5
;
memset
(
&
s
,
0
,
sizeof
(
s
)
);
s
.
size
=
sizeof
(
struct
test
);
s
.
alignment
=
TYPE_ALIGNMENT
(
struct
test
);
s
.
fields
=
fields
;
s
.
fieldCount
=
4
;
s
.
fieldCount
=
5
;
memset
(
&
test
,
0
,
sizeof
(
test
)
);
test
.
int32_ptr
=
&
val
;
...
...
@@ -2679,7 +2689,7 @@ START_TEST(writer)
test_WsCopyNode
();
test_text_types
();
test_double
();
test_field_
flag
s
();
test_field_
option
s
();
test_WsWriteText
();
test_WsWriteArray
();
test_escapes
();
...
...
dlls/webservices/writer.c
View file @
b26b2655
...
...
@@ -1952,16 +1952,13 @@ static HRESULT write_type_struct_field( struct writer *writer, const WS_FIELD_DE
if
(
is_nil_value
(
value
,
size
))
{
if
(
field_options
&
WS_FIELD_OPTIONAL
)
return
S_OK
;
if
(
field_options
&
WS_FIELD_NILLABLE
)
{
if
(
field_options
&
WS_FIELD_POINTER
)
option
=
WS_WRITE_NILLABLE_POINTER
;
else
option
=
WS_WRITE_NILLABLE_VALUE
;
}
else
{
if
(
field_options
&
WS_FIELD_OPTIONAL
)
return
S_OK
;
return
E_INVALIDARG
;
}
else
return
E_INVALIDARG
;
}
else
{
...
...
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