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
78445357
Commit
78445357
authored
Aug 29, 2011
by
Louis Lenders
Committed by
Alexandre Julliard
Sep 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dpnet/tests: Add tests for IDirectPlay8Peer_EnumServiceProviders.
parent
d4947333
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
144 additions
and
0 deletions
+144
-0
configure
configure
+1
-0
configure.ac
configure.ac
+1
-0
Makefile.in
dlls/dpnet/tests/Makefile.in
+7
-0
peer.c
dlls/dpnet/tests/peer.c
+135
-0
No files found.
configure
View file @
78445357
...
...
@@ -14800,6 +14800,7 @@ wine_fn_config_dll dplayx enable_dplayx implib
wine_fn_config_test dlls/dplayx/tests dplayx_test
wine_fn_config_dll dpnaddr enable_dpnaddr
wine_fn_config_dll dpnet enable_dpnet implib
wine_fn_config_test dlls/dpnet/tests dpnet_test
wine_fn_config_dll dpnhpast enable_dpnhpast
wine_fn_config_dll dpnlobby enable_dpnlobby
wine_fn_config_dll dpwsockx enable_dpwsockx
...
...
configure.ac
View file @
78445357
...
...
@@ -2493,6 +2493,7 @@ WINE_CONFIG_DLL(dplayx,,[implib])
WINE_CONFIG_TEST(dlls/dplayx/tests)
WINE_CONFIG_DLL(dpnaddr)
WINE_CONFIG_DLL(dpnet,,[implib])
WINE_CONFIG_TEST(dlls/dpnet/tests)
WINE_CONFIG_DLL(dpnhpast)
WINE_CONFIG_DLL(dpnlobby)
WINE_CONFIG_DLL(dpwsockx)
...
...
dlls/dpnet/tests/Makefile.in
0 → 100644
View file @
78445357
TESTDLL
=
dpnet.dll
IMPORTS
=
dpnet ole32
C_SRCS
=
\
peer.c
@MAKE_TEST_RULES@
dlls/dpnet/tests/peer.c
0 → 100644
View file @
78445357
/*
* Copyright 2011 Louis Lenders
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define INITGUID
#define WIN32_LEAN_AND_MEAN
#include <stdio.h>
#include <dplay8.h>
#include "wine/test.h"
static
char
*
show_guid
(
const
GUID
*
guid
,
char
*
buf
)
{
sprintf
(
buf
,
"{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}"
,
guid
->
Data1
,
guid
->
Data2
,
guid
->
Data3
,
guid
->
Data4
[
0
],
guid
->
Data4
[
1
],
guid
->
Data4
[
2
],
guid
->
Data4
[
3
],
guid
->
Data4
[
4
],
guid
->
Data4
[
5
],
guid
->
Data4
[
6
],
guid
->
Data4
[
7
]);
return
buf
;
}
static
IDirectPlay8Peer
*
peer
=
NULL
;
static
HRESULT
WINAPI
DirectPlayMessageHandler
(
PVOID
context
,
DWORD
message_id
,
PVOID
buffer
)
{
return
S_OK
;
}
static
void
test_init_dp
(
void
)
{
HRESULT
hr
;
hr
=
CoInitialize
(
0
);
ok
(
hr
==
S_OK
,
"CoInitialize failed with %x
\n
"
,
hr
);
hr
=
CoCreateInstance
(
&
CLSID_DirectPlay8Peer
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectPlay8Peer
,
(
void
**
)
&
peer
);
ok
(
hr
==
S_OK
,
"CoCreateInstance failed with 0x%x
\n
"
,
hr
);
hr
=
IDirectPlay8Peer_Initialize
(
peer
,
NULL
,
DirectPlayMessageHandler
,
0
);
todo_wine
ok
(
hr
==
S_OK
,
"IDirectPlay8Peer_Initialize failed with %x
\n
"
,
hr
);
}
static
void
test_enum_service_providers
(
void
)
{
DPN_SERVICE_PROVIDER_INFO
*
serv_prov_info
;
DWORD
items
,
size
;
DWORD
i
;
HRESULT
hr
;
char
guid
[
39
]
;
size
=
0
;
items
=
0
;
hr
=
IDirectPlay8Peer_EnumServiceProviders
(
peer
,
NULL
,
NULL
,
NULL
,
&
size
,
&
items
,
0
);
todo_wine
ok
(
hr
==
DPNERR_BUFFERTOOSMALL
,
"IDirectPlay8Peer_EnumServiceProviders failed with %x
\n
"
,
hr
);
todo_wine
ok
(
size
!=
0
,
"size is unexpectedly 0
\n
"
);
serv_prov_info
=
(
DPN_SERVICE_PROVIDER_INFO
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
hr
=
IDirectPlay8Peer_EnumServiceProviders
(
peer
,
NULL
,
NULL
,
serv_prov_info
,
&
size
,
&
items
,
0
);
todo_wine
ok
(
hr
==
S_OK
,
"IDirectPlay8Peer_EnumServiceProviders failed with %x
\n
"
,
hr
);
todo_wine
ok
(
items
!=
0
,
"Found unexpectedly no service providers
\n
"
);
trace
(
"number of items found: %d
\n
"
,
items
);
for
(
i
=
0
;
i
<
items
;
i
++
)
{
trace
(
"Found Service Provider: %s
\n
"
,
wine_dbgstr_w
(
serv_prov_info
->
pwszName
));
trace
(
"Found guid: %s
\n
"
,
show_guid
(
&
serv_prov_info
->
guid
,
guid
));
serv_prov_info
++
;
}
serv_prov_info
-=
items
;
/* set pointer back */
ok
(
HeapFree
(
GetProcessHeap
(),
0
,
serv_prov_info
),
"Failed freeing server provider info
\n
"
);
size
=
0
;
items
=
0
;
hr
=
IDirectPlay8Peer_EnumServiceProviders
(
peer
,
&
CLSID_DP8SP_TCPIP
,
NULL
,
NULL
,
&
size
,
&
items
,
0
);
todo_wine
ok
(
hr
==
DPNERR_BUFFERTOOSMALL
,
"IDirectPlay8Peer_EnumServiceProviders failed with %x
\n
"
,
hr
);
todo_wine
ok
(
size
!=
0
,
"size is unexpectedly 0
\n
"
);
serv_prov_info
=
(
DPN_SERVICE_PROVIDER_INFO
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
hr
=
IDirectPlay8Peer_EnumServiceProviders
(
peer
,
&
CLSID_DP8SP_TCPIP
,
NULL
,
serv_prov_info
,
&
size
,
&
items
,
0
);
todo_wine
ok
(
hr
==
S_OK
,
"IDirectPlay8Peer_EnumServiceProviders failed with %x
\n
"
,
hr
);
todo_wine
ok
(
items
!=
0
,
"Found unexpectedly no adapter
\n
"
);
for
(
i
=
0
;
i
<
items
;
i
++
)
{
trace
(
"Found adapter: %s
\n
"
,
wine_dbgstr_w
(
serv_prov_info
->
pwszName
));
trace
(
"Found adapter guid: %s
\n
"
,
show_guid
(
&
serv_prov_info
->
guid
,
guid
));
serv_prov_info
++
;
}
serv_prov_info
-=
items
;
/* set pointer back */
ok
(
HeapFree
(
GetProcessHeap
(),
0
,
serv_prov_info
),
"Failed freeing server provider info
\n
"
);
}
static
void
test_cleanup_dp
(
void
)
{
HRESULT
hr
;
hr
=
IDirectPlay8Peer_Close
(
peer
,
0
);
ok
(
hr
==
S_OK
,
"IDirectPlay8Peer_Close failed with %x
\n
"
,
hr
);
hr
=
IDirectPlay8Peer_Release
(
peer
);
ok
(
hr
==
S_OK
,
"IDirectPlay8Peer_Release failed with %x
\n
"
,
hr
);
CoUninitialize
();
}
START_TEST
(
peer
)
{
test_init_dp
();
test_enum_service_providers
();
test_cleanup_dp
();
}
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