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
f3f07bdf
Commit
f3f07bdf
authored
Oct 27, 2015
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Added RpcMgmtIsServerListening tests.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
41f93d8f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
server.c
dlls/rpcrt4/tests/server.c
+29
-0
No files found.
dlls/rpcrt4/tests/server.c
View file @
f3f07bdf
...
...
@@ -1532,6 +1532,26 @@ set_auth_info(RPC_BINDING_HANDLE handle)
ok
(
status
==
RPC_S_OK
,
"RpcBindingSetAuthInfoExA failed %d
\n
"
,
status
);
}
#define test_is_server_listening(a,b) _test_is_server_listening(__LINE__,a,b)
static
void
_test_is_server_listening
(
unsigned
line
,
RPC_BINDING_HANDLE
binding
,
RPC_STATUS
expected_status
)
{
RPC_STATUS
status
;
status
=
RpcMgmtIsServerListening
(
binding
);
ok_
(
__FILE__
,
line
)(
status
==
expected_status
,
"RpcMgmtIsServerListening returned %u, expected %u
\n
"
,
status
,
expected_status
);
}
#define test_is_server_listening2(a,b,c) _test_is_server_listening2(__LINE__,a,b,c)
static
void
_test_is_server_listening2
(
unsigned
line
,
RPC_BINDING_HANDLE
binding
,
RPC_STATUS
expected_status
,
RPC_STATUS
expected_status2
)
{
RPC_STATUS
status
;
status
=
RpcMgmtIsServerListening
(
binding
);
ok_
(
__FILE__
,
line
)(
status
==
expected_status
||
status
==
expected_status2
,
"RpcMgmtIsServerListening returned %u, expected %u or %u
\n
"
,
status
,
expected_status
,
expected_status2
);
}
static
void
client
(
const
char
*
test
)
{
...
...
@@ -1553,6 +1573,7 @@ client(const char *test)
run_tests
();
authinfo_test
(
RPC_PROTSEQ_TCP
,
0
);
test_is_server_listening2
(
IServer_IfHandle
,
RPC_S_OK
,
RPC_S_ACCESS_DENIED
);
ok
(
RPC_S_OK
==
RpcStringFreeA
(
&
binding
),
"RpcStringFree
\n
"
);
ok
(
RPC_S_OK
==
RpcBindingFree
(
&
IServer_IfHandle
),
"RpcBindingFree
\n
"
);
...
...
@@ -1564,6 +1585,7 @@ client(const char *test)
set_auth_info
(
IServer_IfHandle
);
authinfo_test
(
RPC_PROTSEQ_TCP
,
1
);
test_is_server_listening
(
IServer_IfHandle
,
RPC_S_ACCESS_DENIED
);
ok
(
RPC_S_OK
==
RpcStringFreeA
(
&
binding
),
"RpcStringFree
\n
"
);
ok
(
RPC_S_OK
==
RpcBindingFree
(
&
IServer_IfHandle
),
"RpcBindingFree
\n
"
);
...
...
@@ -1575,6 +1597,7 @@ client(const char *test)
run_tests
();
/* can cause RPC_X_BAD_STUB_DATA exception */
authinfo_test
(
RPC_PROTSEQ_LRPC
,
0
);
test_is_server_listening
(
IServer_IfHandle
,
RPC_S_OK
);
ok
(
RPC_S_OK
==
RpcStringFreeA
(
&
binding
),
"RpcStringFree
\n
"
);
ok
(
RPC_S_OK
==
RpcBindingFree
(
&
IServer_IfHandle
),
"RpcBindingFree
\n
"
);
...
...
@@ -1586,6 +1609,7 @@ client(const char *test)
set_auth_info
(
IServer_IfHandle
);
authinfo_test
(
RPC_PROTSEQ_LRPC
,
1
);
test_is_server_listening
(
IServer_IfHandle
,
RPC_S_OK
);
ok
(
RPC_S_OK
==
RpcStringFreeA
(
&
binding
),
"RpcStringFree
\n
"
);
ok
(
RPC_S_OK
==
RpcBindingFree
(
&
IServer_IfHandle
),
"RpcBindingFree
\n
"
);
...
...
@@ -1595,9 +1619,12 @@ client(const char *test)
ok
(
RPC_S_OK
==
RpcStringBindingComposeA
(
NULL
,
np
,
address_np
,
pipe
,
NULL
,
&
binding
),
"RpcStringBindingCompose
\n
"
);
ok
(
RPC_S_OK
==
RpcBindingFromStringBindingA
(
binding
,
&
IServer_IfHandle
),
"RpcBindingFromStringBinding
\n
"
);
test_is_server_listening
(
IServer_IfHandle
,
RPC_S_OK
);
run_tests
();
authinfo_test
(
RPC_PROTSEQ_NMP
,
0
);
test_is_server_listening
(
IServer_IfHandle
,
RPC_S_OK
);
stop
();
test_is_server_listening
(
IServer_IfHandle
,
RPC_S_NOT_LISTENING
);
ok
(
RPC_S_OK
==
RpcStringFreeA
(
&
binding
),
"RpcStringFree
\n
"
);
ok
(
RPC_S_OK
==
RpcBindingFree
(
&
IServer_IfHandle
),
"RpcBindingFree
\n
"
);
...
...
@@ -1638,8 +1665,10 @@ server(void)
else
status
=
RpcServerRegisterIf
(
s_IServer_v0_0_s_ifspec
,
NULL
,
NULL
);
ok
(
status
==
RPC_S_OK
,
"RpcServerRegisterIf failed with status %d
\n
"
,
status
);
test_is_server_listening
(
NULL
,
RPC_S_NOT_LISTENING
);
status
=
RpcServerListen
(
1
,
20
,
TRUE
);
ok
(
status
==
RPC_S_OK
,
"RpcServerListen failed with status %d
\n
"
,
status
);
test_is_server_listening
(
NULL
,
RPC_S_OK
);
stop_event
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
ok
(
stop_event
!=
NULL
,
"CreateEvent failed with error %d
\n
"
,
GetLastError
());
...
...
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