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
28ac1f14
Commit
28ac1f14
authored
Jun 06, 2018
by
Hans Leidekker
Committed by
Alexandre Julliard
Jun 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices/tests: Make test data local if it's only used in one place.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
10897a1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
62 deletions
+54
-62
reader.c
dlls/webservices/tests/reader.c
+54
-62
No files found.
dlls/webservices/tests/reader.c
View file @
28ac1f14
...
...
@@ -67,57 +67,6 @@ static const char data9[] =
static
const
char
data10
[]
=
"<a></b>"
;
static
const
char
data11
[]
=
"<o:OfficeConfig xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
>"
"<o:services o:GenerationTime=
\"
2015-09-03T18:47:54
\"
>"
"<!--Build: 16.0.6202.6852-->"
"</o:services>"
"</o:OfficeConfig>"
;
static
const
char
data11b
[]
=
"<o:OfficeConfig xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
>"
"<o:services o:GenerationTime=
\"
2015-09-03T18:47:54
\"
></o:services>"
"<trailing>content</trailing>"
"</o:OfficeConfig>"
;
static
const
char
data12
[]
=
"<services>"
"<service><id>1</id></service>"
"<service><id>2</id></service>"
"</services>"
;
static
const
char
data13
[]
=
"<services></services>"
;
static
const
char
data14
[]
=
"<services>"
"<wrapper>"
"<service><id>1</id></service>"
"<service><id>2</id></service>"
"</wrapper>"
"</services>"
;
static
const
char
data15
[]
=
"<services>"
"<wrapper>"
"<service>1</service>"
"<service>2</service>"
"</wrapper>"
"</services>"
;
static
const
char
data16
[]
=
"<services>"
"<wrapper>"
"<service name='1'>1</service>"
"<service name='2'>2</service>"
"</wrapper>"
"</services>"
;
static
const
char
data17
[]
=
"<services>"
"<service><name></name></service>"
"</services>"
;
static
void
test_WsCreateError
(
void
)
{
HRESULT
hr
;
...
...
@@ -2997,6 +2946,17 @@ static void test_text_field_mapping(void)
static
void
test_complex_struct_type
(
void
)
{
static
const
char
data
[]
=
"<o:OfficeConfig xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
>"
"<o:services o:GenerationTime=
\"
2015-09-03T18:47:54
\"
>"
"<!--Build: 16.0.6202.6852-->"
"</o:services>"
"</o:OfficeConfig>"
;
static
const
char
data2
[]
=
"<o:OfficeConfig xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
>"
"<o:services o:GenerationTime=
\"
2015-09-03T18:47:54
\"
></o:services>"
"<trailing>content</trailing>"
"</o:OfficeConfig>"
;
static
const
WCHAR
timestampW
[]
=
{
'2'
,
'0'
,
'1'
,
'5'
,
'-'
,
'0'
,
'9'
,
'-'
,
'0'
,
'3'
,
'T'
,
'1'
,
'8'
,
':'
,
'4'
,
'7'
,
':'
,
'5'
,
'4'
,
0
};
HRESULT
hr
;
...
...
@@ -3035,7 +2995,7 @@ static void test_complex_struct_type(void)
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
/* element content type mapping */
prepare_struct_type_test
(
reader
,
data
11
);
prepare_struct_type_test
(
reader
,
data
);
hr
=
WsReadToStartElement
(
reader
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
@@ -3112,7 +3072,7 @@ static void test_complex_struct_type(void)
ok
(
hr
==
WS_E_INVALID_FORMAT
,
"got %08x
\n
"
,
hr
);
/* element type mapping */
prepare_struct_type_test
(
reader
,
data
11
);
prepare_struct_type_test
(
reader
,
data
);
hr
=
WsReadToStartElement
(
reader
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
@@ -3136,7 +3096,7 @@ static void test_complex_struct_type(void)
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_EOF
,
"got %u
\n
"
,
node
->
nodeType
);
/* trailing content */
prepare_struct_type_test
(
reader
,
data
11b
);
prepare_struct_type_test
(
reader
,
data
2
);
hr
=
WsReadToStartElement
(
reader
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
@@ -3149,7 +3109,7 @@ static void test_complex_struct_type(void)
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
node
->
nodeType
==
WS_XML_NODE_TYPE_EOF
,
"got %u
\n
"
,
node
->
nodeType
);
prepare_struct_type_test
(
reader
,
data
11b
);
prepare_struct_type_test
(
reader
,
data
2
);
hr
=
WsReadToStartElement
(
reader
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
@@ -3165,6 +3125,38 @@ static void test_complex_struct_type(void)
static
void
test_repeating_element
(
void
)
{
static
const
char
data
[]
=
"<services>"
"<service><id>1</id></service>"
"<service><id>2</id></service>"
"</services>"
;
static
const
char
data2
[]
=
"<services></services>"
;
static
const
char
data3
[]
=
"<services>"
"<wrapper>"
"<service><id>1</id></service>"
"<service><id>2</id></service>"
"</wrapper>"
"</services>"
;
static
const
char
data4
[]
=
"<services>"
"<wrapper>"
"<service>1</service>"
"<service>2</service>"
"</wrapper>"
"</services>"
;
static
const
char
data5
[]
=
"<services>"
"<wrapper>"
"<service name='1'>1</service>"
"<service name='2'>2</service>"
"</wrapper>"
"</services>"
;
static
const
char
data6
[]
=
"<services>"
"<service><name></name></service>"
"</services>"
;
static
const
WCHAR
oneW
[]
=
{
'1'
,
0
},
twoW
[]
=
{
'2'
,
0
};
WS_XML_STRING
str_name
=
{
4
,
(
BYTE
*
)
"name"
};
WS_XML_STRING
str_services
=
{
8
,
(
BYTE
*
)
"services"
};
...
...
@@ -3214,7 +3206,7 @@ static void test_repeating_element(void)
hr
=
WsCreateReader
(
NULL
,
0
,
&
reader
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
prepare_struct_type_test
(
reader
,
data
12
);
prepare_struct_type_test
(
reader
,
data
);
memset
(
&
f2
,
0
,
sizeof
(
f2
)
);
f2
.
mapping
=
WS_ELEMENT_FIELD_MAPPING
;
...
...
@@ -3257,7 +3249,7 @@ static void test_repeating_element(void)
ok
(
test
->
service
[
1
].
id
==
2
,
"got %u
\n
"
,
test
->
service
[
1
].
id
);
/* array of pointers */
prepare_struct_type_test
(
reader
,
data
12
);
prepare_struct_type_test
(
reader
,
data
);
f
.
options
=
WS_FIELD_POINTER
;
test4
=
NULL
;
hr
=
WsReadType
(
reader
,
WS_ELEMENT_TYPE_MAPPING
,
WS_STRUCT_TYPE
,
&
s
,
...
...
@@ -3272,7 +3264,7 @@ static void test_repeating_element(void)
}
/* item range */
prepare_struct_type_test
(
reader
,
data
13
);
prepare_struct_type_test
(
reader
,
data
2
);
f
.
options
=
0
;
range
.
minItemCount
=
0
;
range
.
maxItemCount
=
1
;
...
...
@@ -3286,7 +3278,7 @@ static void test_repeating_element(void)
ok
(
!
test
->
service_count
,
"got %u
\n
"
,
test
->
service_count
);
/* wrapper element */
prepare_struct_type_test
(
reader
,
data
14
);
prepare_struct_type_test
(
reader
,
data
3
);
f
.
itemRange
=
NULL
;
f
.
localName
=
&
str_wrapper
;
f
.
ns
=
&
str_ns
;
...
...
@@ -3301,7 +3293,7 @@ static void test_repeating_element(void)
ok
(
test
->
service
[
1
].
id
==
2
,
"got %u
\n
"
,
test
->
service
[
1
].
id
);
/* repeating text field mapping */
prepare_struct_type_test
(
reader
,
data
15
);
prepare_struct_type_test
(
reader
,
data
4
);
f2
.
mapping
=
WS_TEXT_FIELD_MAPPING
;
f2
.
localName
=
NULL
;
f2
.
ns
=
NULL
;
...
...
@@ -3319,7 +3311,7 @@ static void test_repeating_element(void)
ok
(
!
lstrcmpW
(
test2
->
service
[
1
].
id
,
twoW
),
"wrong data
\n
"
);
/* repeating attribute field + text field mapping */
prepare_struct_type_test
(
reader
,
data
16
);
prepare_struct_type_test
(
reader
,
data
5
);
f2
.
offset
=
FIELD_OFFSET
(
struct
service3
,
id
);
memset
(
&
f3
,
0
,
sizeof
(
f3
)
);
f3
.
mapping
=
WS_ATTRIBUTE_FIELD_MAPPING
;
...
...
@@ -3344,7 +3336,7 @@ static void test_repeating_element(void)
ok
(
!
lstrcmpW
(
test3
->
service
[
1
].
id
,
twoW
),
"wrong data
\n
"
);
/* empty text, item range */
prepare_struct_type_test
(
reader
,
data
17
);
prepare_struct_type_test
(
reader
,
data
6
);
memset
(
&
f2
,
0
,
sizeof
(
f2
)
);
f2
.
mapping
=
WS_ELEMENT_FIELD_MAPPING
;
...
...
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