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
59c0dbb6
Commit
59c0dbb6
authored
Jun 08, 2020
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jun 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4/tests: Add some tests for marshalling embedded conformant arrays.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bd995ea8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
0 deletions
+81
-0
server.c
dlls/rpcrt4/tests/server.c
+54
-0
server.idl
dlls/rpcrt4/tests/server.idl
+27
-0
No files found.
dlls/rpcrt4/tests/server.c
View file @
59c0dbb6
...
...
@@ -94,6 +94,9 @@ static int (__cdecl *sum_cps)(cps_t *cps);
static
int
(
__cdecl
*
sum_cpsc
)(
cpsc_t
*
cpsc
);
static
int
(
__cdecl
*
get_cpsc
)(
int
n
,
cpsc_t
*
cpsc
);
static
int
(
__cdecl
*
sum_complex_array
)(
int
n
,
refpint_t
pi
[]);
static
int
(
__cdecl
*
sum_blob
)(
cs_blob_t
*
blob
);
static
int
(
__cdecl
*
sum_data
)(
cs_data_t
*
data
);
static
int
(
__cdecl
*
sum_container
)(
cs_container_t
*
container
);
static
int
(
__cdecl
*
square_puint
)(
puint_t
p
);
static
int
(
__cdecl
*
sum_puints
)(
puints_t
*
p
);
static
int
(
__cdecl
*
sum_cpuints
)(
cpuints_t
*
p
);
...
...
@@ -185,6 +188,9 @@ static void (__cdecl *test_handle)(ctx_handle_t ctx_handle);
X(sum_cpsc) \
X(get_cpsc) \
X(sum_complex_array) \
X(sum_blob) \
X(sum_data) \
X(sum_container) \
X(square_puint) \
X(sum_puints) \
X(sum_cpuints) \
...
...
@@ -507,6 +513,36 @@ int __cdecl s_sum_complex_array(int n, refpint_t pi[])
return
total
;
}
int
__cdecl
s_sum_blob
(
cs_blob_t
*
blob
)
{
int
i
,
total
=
0
;
for
(
i
=
0
;
i
<
blob
->
n
;
i
++
)
total
+=
blob
->
ca
[
i
];
return
total
;
}
int
__cdecl
s_sum_data
(
cs_data_t
*
data
)
{
int
i
,
total
=
0
;
for
(
i
=
0
;
i
<
data
->
blob
.
n
;
i
++
)
total
+=
data
->
blob
.
ca
[
i
];
return
total
;
}
int
__cdecl
s_sum_container
(
cs_container_t
*
container
)
{
int
i
,
total
=
0
;
for
(
i
=
0
;
i
<
container
->
data
.
blob
.
n
;
i
++
)
total
+=
container
->
data
.
blob
.
ca
[
i
];
return
total
;
}
int
__cdecl
s_dot_two_vectors
(
vector_t
vs
[
2
])
{
return
vs
[
0
].
x
*
vs
[
1
].
x
+
vs
[
0
].
y
*
vs
[
1
].
y
+
vs
[
0
].
z
*
vs
[
1
].
z
;
...
...
@@ -1618,6 +1654,9 @@ array_tests(void)
vector_t
vs
[
2
]
=
{{
1
,
-
2
,
3
},
{
4
,
-
5
,
-
6
}};
cps_t
cps
;
cpsc_t
cpsc
;
cs_blob_t
blob
;
cs_data_t
data
;
cs_container_t
container
;
cs_t
*
cs
;
int
n
;
int
ca
[
5
]
=
{
1
,
-
2
,
3
,
-
4
,
5
};
...
...
@@ -1761,6 +1800,21 @@ array_tests(void)
ok
(
sum_ptr_array
(
ptr_array
)
==
3
,
"RPC sum_ptr_array
\n
"
);
ok
(
sum_array_ptr
(
&
array
)
==
7
,
"RPC sum_array_ptr
\n
"
);
blob
.
n
=
ARRAY_SIZE
(
c
);
blob
.
ca
=
c
;
n
=
sum_blob
(
&
blob
);
ok
(
n
==
45
,
"RPC sum_blob = %d
\n
"
,
n
);
data
.
blob
.
n
=
ARRAY_SIZE
(
c
);
data
.
blob
.
ca
=
c
;
n
=
sum_data
(
&
data
);
ok
(
n
==
45
,
"RPC sum_data = %d
\n
"
,
n
);
container
.
data
.
blob
.
n
=
ARRAY_SIZE
(
c
);
container
.
data
.
blob
.
ca
=
c
;
n
=
sum_container
(
&
container
);
ok
(
n
==
45
,
"RPC sum_container = %d
\n
"
,
n
);
}
void
__cdecl
s_authinfo_test
(
unsigned
int
protseq
,
int
secure
)
...
...
dlls/rpcrt4/tests/server.idl
View file @
59c0dbb6
...
...
@@ -171,6 +171,30 @@ cpp_quote("#ifndef SKIP_TYPE_DECLS")
typedef struct
{
int n;
[size_is(n)] int *ca;
} cs_blob_t;
typedef struct
{
/* FIXME: widl generates incorrect correlation descriptor and the tests crash */
#if 0
int dummy[1]; /* to make offset to conformant array unique */
#endif
cs_blob_t blob;
} cs_data_t;
typedef struct
{
/* FIXME: widl generates incorrect correlation descriptor and the tests crash */
#if 0
int dummy[2]; /* to make offset to conformant array unique */
#endif
cs_data_t data;
} cs_container_t;
typedef struct
{
int *pn;
[size_is(*pn)] int *ca1;
[size_is(n * 2)] int *ca2;
...
...
@@ -191,6 +215,9 @@ cpp_quote("#endif")
int sum_cpsc(cpsc_t *cpsc);
int get_cpsc(int n, [out] cpsc_t *cpsc );
int sum_complex_array(int n, [size_is(n)] refpint_t pi[]);
int sum_blob([in] cs_blob_t *blob);
int sum_data([in] cs_data_t *data);
int sum_container([in] cs_container_t *container);
cpp_quote("#ifndef SKIP_TYPE_DECLS")
typedef [wire_marshal(int)] void *puint_t;
...
...
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