From 722ecd5e6549ffb20fc7c08deda83e978fdbb446 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Tue, 1 Mar 2022 08:35:07 +0100 Subject: [PATCH] netprofm/tests: Enable compilation with long types. Signed-off-by: Eric Pouech Signed-off-by: Alexandre Julliard --- dlls/netprofm/tests/Makefile.in | 1 - dlls/netprofm/tests/list.c | 96 ++++++++++++++++----------------- 2 files changed, 48 insertions(+), 49 deletions(-) diff --git a/dlls/netprofm/tests/Makefile.in b/dlls/netprofm/tests/Makefile.in index 1b40b618f04..3b5be5c5453 100644 --- a/dlls/netprofm/tests/Makefile.in +++ b/dlls/netprofm/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = netprofm.dll IMPORTS = oleaut32 ole32 diff --git a/dlls/netprofm/tests/list.c b/dlls/netprofm/tests/list.c index 56052ceb512..9295eeebc7c 100644 --- a/dlls/netprofm/tests/list.c +++ b/dlls/netprofm/tests/list.c @@ -37,49 +37,49 @@ static void test_INetwork( INetwork *network ) str = NULL; hr = INetwork_GetName( network, &str ); - todo_wine ok( hr == S_OK, "got %08x\n", hr ); + todo_wine ok( hr == S_OK, "got %08lx\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( hr == S_OK, "got %08lx\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 ); + ok( hr == S_OK, "got %08lx\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( hr == S_OK, "got %08lx\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( hr == S_OK, "got %08lx\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( hr == S_OK, "got %08lx\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 ); + ok( hr == S_OK, "got %08lx\n", hr ); trace("connected %d\n", connected); connected = 0xdead; hr = INetwork_get_IsConnectedToInternet( network, &connected ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\n", hr ); trace("connected to internet %d\n", connected); } @@ -95,39 +95,39 @@ static void test_INetworkConnection( INetworkConnection *conn ) memset( &id, 0, sizeof(id) ); hr = INetworkConnection_GetAdapterId( conn, &id ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\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 ); + ok( hr == S_OK, "got %08lx\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( hr == S_OK, "got %08lx\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( hr == S_OK, "got %08lx\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 ); + ok( hr == S_OK, "got %08lx\n", hr ); trace("connected %d\n", connected); connected = 0xdead; hr = INetworkConnection_get_IsConnectedToInternet( conn, &connected ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\n", hr ); trace("connected to internet %d\n", connected); network = NULL; hr = INetworkConnection_GetNetwork( conn, &network ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\n", hr ); if (network) { test_INetwork( network ); @@ -136,7 +136,7 @@ static void test_INetworkConnection( INetworkConnection *conn ) conn_cost = NULL; hr = INetworkConnection_QueryInterface( conn, &IID_INetworkConnectionCost, (void **)&conn_cost ); - ok( hr == S_OK || broken(hr == E_NOINTERFACE), "got %08x\n", hr ); + ok( hr == S_OK || broken(hr == E_NOINTERFACE), "got %08lx\n", hr ); if (conn_cost) { DWORD cost; @@ -144,13 +144,13 @@ static void test_INetworkConnection( INetworkConnection *conn ) cost = 0xdeadbeef; hr = INetworkConnectionCost_GetCost( conn_cost, &cost ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\n", hr ); ok( cost != 0xdeadbeef, "cost not set\n" ); - trace("cost %08x\n", cost); + trace("cost %08lx\n", cost); memset( &status, 0,sizeof(status) ); hr = INetworkConnectionCost_GetDataPlanStatus( conn_cost, &status ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\n", hr ); trace("InterfaceGuid %s\n", wine_dbgstr_guid(&status.InterfaceGuid)); INetworkConnectionCost_Release( conn_cost ); @@ -242,104 +242,104 @@ static void test_INetworkListManager( void ) connectivity = 0xdeadbeef; hr = INetworkListManager_GetConnectivity( mgr, &connectivity ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\n", hr ); ok( connectivity != 0xdeadbeef, "unchanged value\n" ); trace( "GetConnectivity: %08x\n", connectivity ); connected = 0xdead; hr = INetworkListManager_IsConnected( mgr, &connected ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\n", hr ); ok( connected == VARIANT_TRUE || connected == VARIANT_FALSE, "expected boolean value\n" ); connected = 0xdead; hr = INetworkListManager_IsConnectedToInternet( mgr, &connected ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\n", hr ); ok( connected == VARIANT_TRUE || connected == VARIANT_FALSE, "expected boolean value\n" ); /* INetworkCostManager is supported starting Win8 */ cost_mgr = NULL; 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 %08lx\n", hr ); if (cost_mgr) { DWORD cost; NLM_DATAPLAN_STATUS status; hr = INetworkCostManager_GetCost( cost_mgr, NULL, NULL ); - ok( hr == E_POINTER, "got %08x\n", hr ); + ok( hr == E_POINTER, "got %08lx\n", hr ); cost = 0xdeadbeef; hr = INetworkCostManager_GetCost( cost_mgr, &cost, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\n", hr ); ok( cost != 0xdeadbeef, "cost not set\n" ); hr = INetworkCostManager_GetDataPlanStatus( cost_mgr, NULL, NULL ); - ok( hr == E_POINTER, "got %08x\n", hr ); + ok( hr == E_POINTER, "got %08lx\n", hr ); hr = INetworkCostManager_GetDataPlanStatus( cost_mgr, &status, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\n", hr ); INetworkCostManager_Release( cost_mgr ); } hr = INetworkListManager_QueryInterface( mgr, &IID_IConnectionPointContainer, (void**)&cpc ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\n", hr ); ref1 = IConnectionPointContainer_AddRef( cpc ); hr = IConnectionPointContainer_FindConnectionPoint( cpc, &IID_INetworkListManagerEvents, &pt ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\n", hr ); ref2 = IConnectionPointContainer_AddRef( cpc ); - ok( ref2 == ref1 + 2, "Expected refcount %d, got %d\n", ref1 + 2, ref2 ); + ok( ref2 == ref1 + 2, "Expected refcount %ld, got %ld\n", ref1 + 2, ref2 ); IConnectionPointContainer_Release( cpc ); IConnectionPointContainer_Release( cpc ); hr = IConnectionPoint_GetConnectionPointContainer( pt, &cpc2 ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\n", hr ); ok( cpc2 == cpc, "Expected cpc2 == %p, but got %p\n", cpc, cpc2 ); IConnectionPointContainer_Release( cpc2 ); memset( &iid, 0, sizeof(iid) ); hr = IConnectionPoint_GetConnectionInterface( pt, &iid ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\n", hr ); ok( !memcmp( &iid, &IID_INetworkListManagerEvents, sizeof(iid) ), "Expected iid to be IID_INetworkListManagerEvents\n" ); hr = IConnectionPoint_Advise( pt, (IUnknown*)&mgr_sink_unk, &cookie); - ok( hr == CO_E_FAILEDTOOPENTHREADTOKEN, "Advise failed: %08x\n", hr ); + ok( hr == CO_E_FAILEDTOOPENTHREADTOKEN, "Advise failed: %08lx\n", hr ); hr = IConnectionPoint_Advise( pt, (IUnknown*)&mgr_sink, &cookie); - ok( hr == S_OK, "Advise failed: %08x\n", hr ); + ok( hr == S_OK, "Advise failed: %08lx\n", hr ); hr = IConnectionPoint_Unadvise( pt, 0xdeadbeef ); - ok( hr == OLE_E_NOCONNECTION || hr == CO_E_FAILEDTOIMPERSONATE, "Unadvise failed: %08x\n", hr ); + ok( hr == OLE_E_NOCONNECTION || hr == CO_E_FAILEDTOIMPERSONATE, "Unadvise failed: %08lx\n", hr ); hr = IConnectionPoint_Unadvise( pt, cookie ); - ok( hr == S_OK, "Unadvise failed: %08x\n", hr ); + ok( hr == S_OK, "Unadvise failed: %08lx\n", hr ); hr = IConnectionPointContainer_FindConnectionPoint( cpc, &IID_INetworkListManagerEvents, &pt2 ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\n", hr ); ok( pt == pt2, "pt != pt2\n"); IConnectionPoint_Release( pt2 ); hr = IConnectionPointContainer_FindConnectionPoint( cpc, &IID_INetworkCostManagerEvents, &pt ); - ok( hr == S_OK || hr == CO_E_FAILEDTOIMPERSONATE, "got %08x\n", hr ); + ok( hr == S_OK || hr == CO_E_FAILEDTOIMPERSONATE, "got %08lx\n", hr ); if (hr == S_OK) IConnectionPoint_Release( 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 %08lx\n", hr ); if (hr == S_OK) IConnectionPoint_Release( pt ); hr = IConnectionPointContainer_FindConnectionPoint( cpc, &IID_INetworkEvents, &pt ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\n", hr ); IConnectionPoint_Release( pt ); IConnectionPointContainer_Release( cpc ); network_iter = NULL; hr = INetworkListManager_GetNetworks( mgr, NLM_ENUM_NETWORK_ALL, &network_iter ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\n", hr ); if (network_iter) { while ((hr = IEnumNetworks_Next( network_iter, 1, &network, NULL )) == S_OK) @@ -352,17 +352,17 @@ static void test_INetworkListManager( void ) conn_iter = NULL; hr = INetworkListManager_GetNetworkConnections( mgr, &conn_iter ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08lx\n", hr ); if (conn_iter) { fetched = 256; hr = IEnumNetworkConnections_Next( conn_iter, 1, NULL, &fetched ); - ok( hr == E_POINTER, "got hr %#x.\n", hr ); - ok( fetched == 256, "got wrong feteched: %d.\n", fetched ); + ok( hr == E_POINTER, "got hr %#lx.\n", hr ); + ok( fetched == 256, "got wrong feteched: %ld.\n", fetched ); hr = IEnumNetworkConnections_Next( conn_iter, 0, NULL, &fetched ); - ok( hr == E_POINTER, "got hr %#x.\n", hr ); - ok( fetched == 256, "got wrong feteched: %d.\n", fetched ); + ok( hr == E_POINTER, "got hr %#lx.\n", hr ); + ok( fetched == 256, "got wrong feteched: %ld.\n", fetched ); while ((hr = IEnumNetworkConnections_Next( conn_iter, 1, &conn, NULL )) == S_OK) { @@ -380,11 +380,11 @@ static void test_INetworkListManager( void ) ref1 = IConnectionPoint_Release( pt ); ref2 = INetworkListManager_Release( mgr ); - ok( ref2 == ref1 - 1, "ref = %u\n", ref1 ); + ok( ref2 == ref1 - 1, "ref = %lu\n", ref1 ); IConnectionPoint_Release( pt ); ref1 = IConnectionPoint_Release( pt ); - ok( !ref1, "ref = %u\n", ref1 ); + ok( !ref1, "ref = %lu\n", ref1 ); } START_TEST( list )