2 * Copyright 2014 Hans Leidekker for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #include "netlistmgr.h"
25 #include "wine/test.h"
27 static void test_INetworkListManager( void )
29 INetworkListManager
*mgr
;
30 INetworkCostManager
*cost_mgr
;
31 NLM_CONNECTIVITY connectivity
;
32 VARIANT_BOOL connected
;
35 hr
= CoCreateInstance( &CLSID_NetworkListManager
, NULL
, CLSCTX_INPROC_SERVER
,
36 &IID_INetworkListManager
, (void **)&mgr
);
39 win_skip( "can't create instance of NetworkListManager\n" );
43 connectivity
= 0xdeadbeef;
44 hr
= INetworkListManager_GetConnectivity( mgr
, &connectivity
);
45 ok( hr
== S_OK
, "got %08x\n", hr
);
46 ok( connectivity
!= 0xdeadbeef, "unchanged value\n" );
47 trace( "GetConnectivity: %08x\n", connectivity
);
50 hr
= INetworkListManager_IsConnected( mgr
, &connected
);
51 ok( hr
== S_OK
, "got %08x\n", hr
);
52 ok( connected
== VARIANT_TRUE
|| connected
== VARIANT_FALSE
, "expected boolean value\n" );
55 hr
= INetworkListManager_IsConnectedToInternet( mgr
, &connected
);
56 ok( hr
== S_OK
, "got %08x\n", hr
);
57 ok( connected
== VARIANT_TRUE
|| connected
== VARIANT_FALSE
, "expected boolean value\n" );
59 INetworkListManager_QueryInterface( mgr
, &IID_INetworkCostManager
, (void **)&cost_mgr
);
60 ok( hr
== S_OK
, "got %08x\n", hr
);
65 hr
= INetworkCostManager_GetCost( cost_mgr
, NULL
, NULL
);
66 ok( hr
== E_POINTER
, "got %08x\n", hr
);
69 hr
= INetworkCostManager_GetCost( cost_mgr
, &cost
, NULL
);
70 ok( hr
== S_OK
, "got %08x\n", hr
);
71 ok( cost
!= 0xdeadbeef, "cost not set\n" );
73 INetworkCostManager_Release( cost_mgr
);
76 INetworkListManager_Release( mgr
);
82 test_INetworkListManager();