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
d3857726
Commit
d3857726
authored
Sep 02, 2015
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 02, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netprofm/tests: Add tests.
parent
c1c434d1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
165 additions
and
3 deletions
+165
-3
Makefile.in
dlls/netprofm/tests/Makefile.in
+1
-1
list.c
dlls/netprofm/tests/list.c
+164
-2
No files found.
dlls/netprofm/tests/Makefile.in
View file @
d3857726
TESTDLL
=
netprofm.dll
TESTDLL
=
netprofm.dll
IMPORTS
=
ole32
IMPORTS
=
ole
aut32 ole
32
C_SRCS
=
\
C_SRCS
=
\
list.c
list.c
dlls/netprofm/tests/list.c
View file @
d3857726
...
@@ -25,6 +25,138 @@
...
@@ -25,6 +25,138 @@
#include "netlistmgr.h"
#include "netlistmgr.h"
#include "wine/test.h"
#include "wine/test.h"
static
void
test_INetwork
(
INetwork
*
network
)
{
NLM_NETWORK_CATEGORY
category
;
NLM_CONNECTIVITY
connectivity
;
NLM_DOMAIN_TYPE
domain_type
;
VARIANT_BOOL
connected
;
GUID
id
;
BSTR
str
;
HRESULT
hr
;
str
=
NULL
;
hr
=
INetwork_GetName
(
network
,
&
str
);
todo_wine
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
todo_wine
ok
(
str
!=
NULL
,
"str not set
\n
"
);
if
(
str
)
trace
(
"name %s
\n
"
,
wine_dbgstr_w
(
str
)
);
SysFreeString
(
str
);
str
=
NULL
;
hr
=
INetwork_GetDescription
(
network
,
&
str
);
todo_wine
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
todo_wine
ok
(
str
!=
NULL
,
"str not set
\n
"
);
if
(
str
)
trace
(
"description %s
\n
"
,
wine_dbgstr_w
(
str
)
);
SysFreeString
(
str
);
memset
(
&
id
,
0
,
sizeof
(
id
)
);
hr
=
INetwork_GetNetworkId
(
network
,
&
id
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
trace
(
"network id %s
\n
"
,
wine_dbgstr_guid
(
&
id
));
domain_type
=
0xdeadbeef
;
hr
=
INetwork_GetDomainType
(
network
,
&
domain_type
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
domain_type
!=
0xdeadbeef
,
"domain_type not set
\n
"
);
trace
(
"domain type %08x
\n
"
,
domain_type
);
category
=
0xdeadbeef
;
hr
=
INetwork_GetCategory
(
network
,
&
category
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
category
!=
0xdeadbeef
,
"category not set
\n
"
);
trace
(
"category %08x
\n
"
,
category
);
connectivity
=
0xdeadbeef
;
hr
=
INetwork_GetConnectivity
(
network
,
&
connectivity
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
connectivity
!=
0xdeadbeef
,
"connectivity not set
\n
"
);
trace
(
"connectivity %08x
\n
"
,
connectivity
);
connected
=
0xdead
;
hr
=
INetwork_get_IsConnected
(
network
,
&
connected
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
trace
(
"connected %d
\n
"
,
connected
);
connected
=
0xdead
;
hr
=
INetwork_get_IsConnectedToInternet
(
network
,
&
connected
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
trace
(
"connected to internet %d
\n
"
,
connected
);
}
static
void
test_INetworkConnection
(
INetworkConnection
*
conn
)
{
INetwork
*
network
;
INetworkConnectionCost
*
conn_cost
;
NLM_CONNECTIVITY
connectivity
;
NLM_DOMAIN_TYPE
domain_type
;
VARIANT_BOOL
connected
;
GUID
id
;
HRESULT
hr
;
memset
(
&
id
,
0
,
sizeof
(
id
)
);
hr
=
INetworkConnection_GetAdapterId
(
conn
,
&
id
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
trace
(
"adapter id %s
\n
"
,
wine_dbgstr_guid
(
&
id
));
memset
(
&
id
,
0
,
sizeof
(
id
)
);
hr
=
INetworkConnection_GetConnectionId
(
conn
,
&
id
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
trace
(
"connection id %s
\n
"
,
wine_dbgstr_guid
(
&
id
));
connectivity
=
0xdeadbeef
;
hr
=
INetworkConnection_GetConnectivity
(
conn
,
&
connectivity
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
connectivity
!=
0xdeadbeef
,
"connectivity not set
\n
"
);
trace
(
"connectivity %08x
\n
"
,
connectivity
);
domain_type
=
0xdeadbeef
;
hr
=
INetworkConnection_GetDomainType
(
conn
,
&
domain_type
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
domain_type
!=
0xdeadbeef
,
"domain_type not set
\n
"
);
trace
(
"domain type %08x
\n
"
,
domain_type
);
connected
=
0xdead
;
hr
=
INetworkConnection_get_IsConnected
(
conn
,
&
connected
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
trace
(
"connected %d
\n
"
,
connected
);
connected
=
0xdead
;
hr
=
INetworkConnection_get_IsConnectedToInternet
(
conn
,
&
connected
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
trace
(
"connected to internet %d
\n
"
,
connected
);
network
=
NULL
;
hr
=
INetworkConnection_GetNetwork
(
conn
,
&
network
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
if
(
network
)
{
test_INetwork
(
network
);
INetwork_Release
(
network
);
}
conn_cost
=
NULL
;
hr
=
INetworkConnection_QueryInterface
(
conn
,
&
IID_INetworkConnectionCost
,
(
void
**
)
&
conn_cost
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
E_NOINTERFACE
),
"got %08x
\n
"
,
hr
);
if
(
conn_cost
)
{
DWORD
cost
;
NLM_DATAPLAN_STATUS
status
;
cost
=
0xdeadbeef
;
hr
=
INetworkConnectionCost_GetCost
(
conn_cost
,
&
cost
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
cost
!=
0xdeadbeef
,
"cost not set
\n
"
);
trace
(
"cost %08x
\n
"
,
cost
);
memset
(
&
status
,
0
,
sizeof
(
status
)
);
hr
=
INetworkConnectionCost_GetDataPlanStatus
(
conn_cost
,
&
status
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
trace
(
"InterfaceGuid %s
\n
"
,
wine_dbgstr_guid
(
&
status
.
InterfaceGuid
));
INetworkConnectionCost_Release
(
conn_cost
);
}
}
static
void
test_INetworkListManager
(
void
)
static
void
test_INetworkListManager
(
void
)
{
{
IConnectionPointContainer
*
cpc
,
*
cpc2
;
IConnectionPointContainer
*
cpc
,
*
cpc2
;
...
@@ -33,6 +165,10 @@ static void test_INetworkListManager( void )
...
@@ -33,6 +165,10 @@ static void test_INetworkListManager( void )
NLM_CONNECTIVITY
connectivity
;
NLM_CONNECTIVITY
connectivity
;
VARIANT_BOOL
connected
;
VARIANT_BOOL
connected
;
IConnectionPoint
*
pt
;
IConnectionPoint
*
pt
;
IEnumNetworks
*
network_iter
;
INetwork
*
network
;
IEnumNetworkConnections
*
conn_iter
;
INetworkConnection
*
conn
;
HRESULT
hr
;
HRESULT
hr
;
ULONG
ref1
,
ref2
;
ULONG
ref1
,
ref2
;
IID
iid
;
IID
iid
;
...
@@ -62,9 +198,10 @@ static void test_INetworkListManager( void )
...
@@ -62,9 +198,10 @@ static void test_INetworkListManager( void )
ok
(
connected
==
VARIANT_TRUE
||
connected
==
VARIANT_FALSE
,
"expected boolean value
\n
"
);
ok
(
connected
==
VARIANT_TRUE
||
connected
==
VARIANT_FALSE
,
"expected boolean value
\n
"
);
/* INetworkCostManager is supported starting Win8 */
/* INetworkCostManager is supported starting Win8 */
cost_mgr
=
NULL
;
hr
=
INetworkListManager_QueryInterface
(
mgr
,
&
IID_INetworkCostManager
,
(
void
**
)
&
cost_mgr
);
hr
=
INetworkListManager_QueryInterface
(
mgr
,
&
IID_INetworkCostManager
,
(
void
**
)
&
cost_mgr
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
E_NOINTERFACE
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
E_NOINTERFACE
),
"got %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
if
(
cost_mgr
)
{
{
DWORD
cost
;
DWORD
cost
;
NLM_DATAPLAN_STATUS
status
;
NLM_DATAPLAN_STATUS
status
;
...
@@ -119,8 +256,33 @@ static void test_INetworkListManager( void )
...
@@ -119,8 +256,33 @@ static void test_INetworkListManager( void )
hr
=
IConnectionPointContainer_FindConnectionPoint
(
cpc
,
&
IID_INetworkConnectionEvents
,
&
pt
);
hr
=
IConnectionPointContainer_FindConnectionPoint
(
cpc
,
&
IID_INetworkConnectionEvents
,
&
pt
);
ok
(
hr
==
S_OK
||
hr
==
CO_E_FAILEDTOIMPERSONATE
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
||
hr
==
CO_E_FAILEDTOIMPERSONATE
,
"got %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
IConnectionPoint_Release
(
pt
);
if
(
hr
==
S_OK
)
IConnectionPoint_Release
(
pt
);
IConnectionPointContainer_Release
(
cpc
);
IConnectionPointContainer_Release
(
cpc
);
network_iter
=
NULL
;
hr
=
INetworkListManager_GetNetworks
(
mgr
,
NLM_ENUM_NETWORK_ALL
,
&
network_iter
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
if
(
network_iter
)
{
while
((
hr
=
IEnumNetworks_Next
(
network_iter
,
1
,
&
network
,
NULL
))
==
S_OK
)
{
test_INetwork
(
network
);
INetwork_Release
(
network
);
}
IEnumNetworks_Release
(
network_iter
);
}
conn_iter
=
NULL
;
hr
=
INetworkListManager_GetNetworkConnections
(
mgr
,
&
conn_iter
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
if
(
conn_iter
)
{
while
((
hr
=
IEnumNetworkConnections_Next
(
conn_iter
,
1
,
&
conn
,
NULL
))
==
S_OK
)
{
test_INetworkConnection
(
conn
);
INetworkConnection_Release
(
conn
);
}
IEnumNetworkConnections_Release
(
conn_iter
);
}
INetworkListManager_Release
(
mgr
);
INetworkListManager_Release
(
mgr
);
}
}
...
...
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