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
42fd3199
Commit
42fd3199
authored
Aug 02, 2008
by
Ismael Barros
Committed by
Alexandre Julliard
Aug 04, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dplayx: Tests for GetPlayerFlags.
parent
bbbe26bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
106 additions
and
0 deletions
+106
-0
dplayx.c
dlls/dplayx/tests/dplayx.c
+106
-0
No files found.
dlls/dplayx/tests/dplayx.c
View file @
42fd3199
...
...
@@ -2955,6 +2955,111 @@ static void test_GetPlayerAddress(void)
}
/* GetPlayerFlags */
static
void
test_GetPlayerFlags
(
void
)
{
LPDIRECTPLAY4
pDP
[
2
];
DPSESSIONDESC2
dpsd
;
DPID
dpid
[
4
];
HRESULT
hr
;
UINT
i
;
DWORD
dwFlags
=
0
;
for
(
i
=
0
;
i
<
2
;
i
++
)
{
CoCreateInstance
(
&
CLSID_DirectPlay
,
NULL
,
CLSCTX_ALL
,
&
IID_IDirectPlay4A
,
(
LPVOID
*
)
&
pDP
[
i
]
);
}
ZeroMemory
(
&
dpsd
,
sizeof
(
DPSESSIONDESC2
)
);
dpsd
.
dwSize
=
sizeof
(
DPSESSIONDESC2
);
dpsd
.
guidApplication
=
appGuid
;
dpsd
.
dwMaxPlayers
=
10
;
/* Uninitialized service provider */
hr
=
IDirectPlayX_GetPlayerFlags
(
pDP
[
0
],
0
,
&
dwFlags
);
todo_wine
checkHR
(
DPERR_UNINITIALIZED
,
hr
);
if
(
hr
==
DP_OK
)
{
skip
(
"GetPlayerFlags not implemented
\n
"
);
return
;
}
init_TCPIP_provider
(
pDP
[
0
],
"127.0.0.1"
,
0
);
init_TCPIP_provider
(
pDP
[
1
],
"127.0.0.1"
,
0
);
/* No session */
hr
=
IDirectPlayX_GetPlayerFlags
(
pDP
[
0
],
0
,
&
dwFlags
);
checkHR
(
DPERR_INVALIDPLAYER
,
hr
);
hr
=
IDirectPlayX_GetPlayerFlags
(
pDP
[
0
],
1
,
&
dwFlags
);
checkHR
(
DPERR_INVALIDPLAYER
,
hr
);
IDirectPlayX_Open
(
pDP
[
0
],
&
dpsd
,
DPOPEN_CREATE
);
IDirectPlayX_EnumSessions
(
pDP
[
1
],
&
dpsd
,
0
,
EnumSessions_cb_join
,
(
LPVOID
)
pDP
[
1
],
0
);
for
(
i
=
0
;
i
<
2
;
i
++
)
{
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
i
],
&
dpid
[
i
],
NULL
,
NULL
,
NULL
,
0
,
0
);
checkHR
(
DP_OK
,
hr
);
}
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
[
2
],
NULL
,
NULL
,
NULL
,
0
,
DPPLAYER_SPECTATOR
);
checkHR
(
DP_OK
,
hr
);
hr
=
IDirectPlayX_CreatePlayer
(
pDP
[
0
],
&
dpid
[
3
],
NULL
,
NULL
,
NULL
,
0
,
DPPLAYER_SERVERPLAYER
);
checkHR
(
DP_OK
,
hr
);
/* Invalid player */
hr
=
IDirectPlayX_GetPlayerFlags
(
pDP
[
0
],
0
,
&
dwFlags
);
checkHR
(
DPERR_INVALIDPLAYER
,
hr
);
hr
=
IDirectPlayX_GetPlayerFlags
(
pDP
[
0
],
2
,
&
dwFlags
);
checkHR
(
DPERR_INVALIDPLAYER
,
hr
);
/* Invalid parameters */
hr
=
IDirectPlayX_GetPlayerFlags
(
pDP
[
0
],
dpid
[
0
],
NULL
);
checkHR
(
DPERR_INVALIDPARAMS
,
hr
);
/* Regular parameters */
hr
=
IDirectPlayX_GetPlayerFlags
(
pDP
[
0
],
dpid
[
0
],
&
dwFlags
);
checkHR
(
DP_OK
,
hr
);
checkFlags
(
dwFlags
,
DPPLAYER_LOCAL
,
FLAGS_DPPLAYER
);
hr
=
IDirectPlayX_GetPlayerFlags
(
pDP
[
1
],
dpid
[
1
],
&
dwFlags
);
checkHR
(
DP_OK
,
hr
);
checkFlags
(
dwFlags
,
DPPLAYER_LOCAL
,
FLAGS_DPPLAYER
);
hr
=
IDirectPlayX_GetPlayerFlags
(
pDP
[
0
],
dpid
[
1
],
&
dwFlags
);
checkHR
(
DP_OK
,
hr
);
checkFlags
(
dwFlags
,
0
,
FLAGS_DPPLAYER
);
hr
=
IDirectPlayX_GetPlayerFlags
(
pDP
[
0
],
dpid
[
2
],
&
dwFlags
);
checkHR
(
DP_OK
,
hr
);
checkFlags
(
dwFlags
,
DPPLAYER_SPECTATOR
|
DPPLAYER_LOCAL
,
FLAGS_DPPLAYER
);
hr
=
IDirectPlayX_GetPlayerFlags
(
pDP
[
1
],
dpid
[
3
],
&
dwFlags
);
checkHR
(
DP_OK
,
hr
);
checkFlags
(
dwFlags
,
DPPLAYER_SERVERPLAYER
,
FLAGS_DPPLAYER
);
IDirectPlayX_Release
(
pDP
[
0
]
);
IDirectPlayX_Release
(
pDP
[
1
]
);
}
START_TEST
(
dplayx
)
{
...
...
@@ -2975,6 +3080,7 @@ START_TEST(dplayx)
test_PlayerName
();
test_GetPlayerAccount
();
test_GetPlayerAddress
();
test_GetPlayerFlags
();
CoUninitialize
();
}
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