Commit ce22a025 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wbemprox/tests: Build without -DWINE_NO_LONG_TYPES.

parent 0444be5c
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = wbemprox.dll TESTDLL = wbemprox.dll
IMPORTS = uuid oleaut32 ole32 user32 advapi32 IMPORTS = uuid oleaut32 ole32 user32 advapi32
......
...@@ -30,7 +30,7 @@ static void _expect_ref(IUnknown* obj, ULONG ref, int line) ...@@ -30,7 +30,7 @@ static void _expect_ref(IUnknown* obj, ULONG ref, int line)
ULONG rc; ULONG rc;
IUnknown_AddRef(obj); IUnknown_AddRef(obj);
rc = IUnknown_Release(obj); rc = IUnknown_Release(obj);
ok_(__FILE__,line)(rc == ref, "expected refcount %d, got %d\n", ref, rc); ok_(__FILE__,line)(rc == ref, "expected refcount %lu, got %lu\n", ref, rc);
} }
static void test_IClientSecurity(void) static void test_IClientSecurity(void)
...@@ -48,45 +48,45 @@ static void test_IClientSecurity(void) ...@@ -48,45 +48,45 @@ static void test_IClientSecurity(void)
win_skip("can't create instance of WbemLocator\n"); win_skip("can't create instance of WbemLocator\n");
return; return;
} }
ok( hr == S_OK, "failed to create IWbemLocator interface %08x\n", hr ); ok( hr == S_OK, "failed to create IWbemLocator interface %#lx\n", hr );
refs = IWbemLocator_Release( locator ); refs = IWbemLocator_Release( locator );
ok( refs == 0, "unexpected refcount %u\n", refs ); ok( refs == 0, "unexpected refcount %lu\n", refs );
hr = CoCreateInstance( &CLSID_WbemLocator, NULL, CLSCTX_INPROC_SERVER, &IID_IWbemLocator, (void **)&locator ); hr = CoCreateInstance( &CLSID_WbemLocator, NULL, CLSCTX_INPROC_SERVER, &IID_IWbemLocator, (void **)&locator );
ok( hr == S_OK, "failed to create IWbemLocator interface %08x\n", hr ); ok( hr == S_OK, "failed to create IWbemLocator interface %#lx\n", hr );
hr = IWbemLocator_ConnectServer( locator, path, NULL, NULL, NULL, 0, NULL, NULL, &services ); hr = IWbemLocator_ConnectServer( locator, path, NULL, NULL, NULL, 0, NULL, NULL, &services );
ok( hr == S_OK, "failed to get IWbemServices interface %08x\n", hr ); ok( hr == S_OK, "failed to get IWbemServices interface %#lx\n", hr );
refs = IWbemServices_Release( services ); refs = IWbemServices_Release( services );
ok( refs == 0, "unexpected refcount %u\n", refs ); ok( refs == 0, "unexpected refcount %lu\n", refs );
hr = IWbemLocator_ConnectServer( locator, path, NULL, NULL, NULL, 0, NULL, NULL, &services ); hr = IWbemLocator_ConnectServer( locator, path, NULL, NULL, NULL, 0, NULL, NULL, &services );
ok( hr == S_OK, "failed to get IWbemServices interface %08x\n", hr ); ok( hr == S_OK, "failed to get IWbemServices interface %#lx\n", hr );
hr = IWbemServices_QueryInterface( services, &IID_IClientSecurity, (void **)&security ); hr = IWbemServices_QueryInterface( services, &IID_IClientSecurity, (void **)&security );
ok( hr == S_OK, "failed to query IClientSecurity interface %08x\n", hr ); ok( hr == S_OK, "failed to query IClientSecurity interface %#lx\n", hr );
ok( (void *)services != (void *)security, "expected pointers to be different\n" ); ok( (void *)services != (void *)security, "expected pointers to be different\n" );
refs = IClientSecurity_Release( security ); refs = IClientSecurity_Release( security );
ok( refs == 1, "unexpected refcount %u\n", refs ); ok( refs == 1, "unexpected refcount %lu\n", refs );
refs = IWbemServices_Release( services ); refs = IWbemServices_Release( services );
ok( refs == 0, "unexpected refcount %u\n", refs ); ok( refs == 0, "unexpected refcount %lu\n", refs );
hr = IWbemLocator_ConnectServer( locator, path, NULL, NULL, NULL, 0, NULL, NULL, &services ); hr = IWbemLocator_ConnectServer( locator, path, NULL, NULL, NULL, 0, NULL, NULL, &services );
ok( hr == S_OK, "failed to get IWbemServices interface %08x\n", hr ); ok( hr == S_OK, "failed to get IWbemServices interface %#lx\n", hr );
hr = IWbemServices_QueryInterface( services, &IID_IClientSecurity, (void **)&security ); hr = IWbemServices_QueryInterface( services, &IID_IClientSecurity, (void **)&security );
ok( hr == S_OK, "failed to query IClientSecurity interface %08x\n", hr ); ok( hr == S_OK, "failed to query IClientSecurity interface %#lx\n", hr );
ok( (void *)services != (void *)security, "expected pointers to be different\n" ); ok( (void *)services != (void *)security, "expected pointers to be different\n" );
refs = IWbemServices_Release( services ); refs = IWbemServices_Release( services );
todo_wine ok( refs == 1, "unexpected refcount %u\n", refs ); todo_wine ok( refs == 1, "unexpected refcount %lu\n", refs );
refs = IClientSecurity_Release( security ); refs = IClientSecurity_Release( security );
todo_wine ok( refs == 0, "unexpected refcount %u\n", refs ); todo_wine ok( refs == 0, "unexpected refcount %lu\n", refs );
IWbemLocator_Release( locator ); IWbemLocator_Release( locator );
SysFreeString( path ); SysFreeString( path );
...@@ -144,7 +144,7 @@ static void test_IWbemLocator(void) ...@@ -144,7 +144,7 @@ static void test_IWbemLocator(void)
win_skip("can't create instance of WbemLocator\n"); win_skip("can't create instance of WbemLocator\n");
return; return;
} }
ok( hr == S_OK, "failed to create IWbemLocator interface %08x\n", hr ); ok( hr == S_OK, "failed to create IWbemLocator interface %#lx\n", hr );
for (i = 0; i < ARRAY_SIZE( test ); i++) for (i = 0; i < ARRAY_SIZE( test ); i++)
{ {
...@@ -152,24 +152,22 @@ static void test_IWbemLocator(void) ...@@ -152,24 +152,22 @@ static void test_IWbemLocator(void)
hr = IWbemLocator_ConnectServer( locator, resource, NULL, NULL, NULL, 0, NULL, NULL, &services ); hr = IWbemLocator_ConnectServer( locator, resource, NULL, NULL, NULL, 0, NULL, NULL, &services );
todo_wine_if (test[i].todo) todo_wine_if (test[i].todo)
ok( hr == test[i].result || broken(hr == test[i].result_broken), ok( hr == test[i].result || broken(hr == test[i].result_broken),
"%u: expected %08x got %08x\n", i, test[i].result, hr ); "%u: expected %#lx got %#lx\n", i, test[i].result, hr );
SysFreeString( resource ); SysFreeString( resource );
if (hr == S_OK) IWbemServices_Release( services ); if (hr == S_OK) IWbemServices_Release( services );
} }
hr = CoCreateInstance( &CLSID_WbemContext, NULL, CLSCTX_INPROC_SERVER, &IID_IWbemContext, (void **)&context ); hr = CoCreateInstance( &CLSID_WbemContext, NULL, CLSCTX_INPROC_SERVER, &IID_IWbemContext, (void **)&context );
ok(hr == S_OK, "Failed to create context object, hr %#x.\n", hr); ok(hr == S_OK, "failed to create context object, hr %#lx\n", hr);
EXPECT_REF(context, 1); EXPECT_REF(context, 1);
resource = SysAllocString( L"root\\default" ); resource = SysAllocString( L"root\\default" );
hr = IWbemLocator_ConnectServer( locator, resource, NULL, NULL, NULL, 0, NULL, context, &services ); hr = IWbemLocator_ConnectServer( locator, resource, NULL, NULL, NULL, 0, NULL, context, &services );
ok(hr == S_OK, "Failed to connect, hr %#x.\n", hr); ok(hr == S_OK, "failed to connect, hr %#lx\n", hr);
SysFreeString( resource ); SysFreeString( resource );
EXPECT_REF(context, 1); EXPECT_REF(context, 1);
IWbemServices_Release( services ); IWbemServices_Release( services );
IWbemContext_Release( context ); IWbemContext_Release( context );
IWbemLocator_Release( locator ); IWbemLocator_Release( locator );
} }
...@@ -181,68 +179,68 @@ static void test_IWbemContext(void) ...@@ -181,68 +179,68 @@ static void test_IWbemContext(void)
BSTR str; BSTR str;
hr = CoCreateInstance( &CLSID_WbemContext, NULL, CLSCTX_INPROC_SERVER, &IID_IWbemContext, (void **)&context ); hr = CoCreateInstance( &CLSID_WbemContext, NULL, CLSCTX_INPROC_SERVER, &IID_IWbemContext, (void **)&context );
ok(hr == S_OK, "Failed to create context object, hr %#x.\n", hr); ok(hr == S_OK, "failed to create context object, hr %#lx\n", hr);
hr = IWbemContext_SetValue(context, L"name", 0, NULL); hr = IWbemContext_SetValue(context, L"name", 0, NULL);
ok(hr == WBEM_E_INVALID_PARAMETER, "Unexpected hr %#x.\n", hr); ok(hr == WBEM_E_INVALID_PARAMETER, "unexpected hr %#lx\n", hr);
V_VT(&var) = VT_I4; V_VT(&var) = VT_I4;
V_I4(&var) = 12; V_I4(&var) = 12;
hr = IWbemContext_SetValue(context, NULL, 0, &var); hr = IWbemContext_SetValue(context, NULL, 0, &var);
ok(hr == WBEM_E_INVALID_PARAMETER, "Unexpected hr %#x.\n", hr); ok(hr == WBEM_E_INVALID_PARAMETER, "unexpected hr %#lx\n", hr);
hr = IWbemContext_SetValue(context, L"name", 0, &var); hr = IWbemContext_SetValue(context, L"name", 0, &var);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "unexpected hr %#lx\n", hr);
hr = IWbemContext_GetValue(context, NULL, 0, &var); hr = IWbemContext_GetValue(context, NULL, 0, &var);
ok(hr == WBEM_E_INVALID_PARAMETER, "Unexpected hr %#x.\n", hr); ok(hr == WBEM_E_INVALID_PARAMETER, "unexpected hr %#lx\n", hr);
hr = IWbemContext_GetValue(context, L"name", 0, NULL); hr = IWbemContext_GetValue(context, L"name", 0, NULL);
ok(hr == WBEM_E_INVALID_PARAMETER, "Unexpected hr %#x.\n", hr); ok(hr == WBEM_E_INVALID_PARAMETER, "unexpected hr %#lx\n", hr);
hr = IWbemContext_GetValue(context, L"noname", 0, &var); hr = IWbemContext_GetValue(context, L"noname", 0, &var);
ok(hr == WBEM_E_NOT_FOUND, "Unexpected hr %#x.\n", hr); ok(hr == WBEM_E_NOT_FOUND, "unexpected hr %#lx\n", hr);
V_VT(&var) = VT_EMPTY; V_VT(&var) = VT_EMPTY;
hr = IWbemContext_GetValue(context, L"NAME", 0, &var); hr = IWbemContext_GetValue(context, L"NAME", 0, &var);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "unexpected hr %#lx\n", hr);
ok(V_VT(&var) == VT_I4, "Unexpected value type.\n"); ok(V_VT(&var) == VT_I4, "unexpected value type\n");
V_VT(&var) = VT_I4; V_VT(&var) = VT_I4;
V_I4(&var) = 13; V_I4(&var) = 13;
hr = IWbemContext_SetValue(context, L"name2", 0, &var); hr = IWbemContext_SetValue(context, L"name2", 0, &var);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "unexpected hr %#lx\n", hr);
hr = IWbemContext_Next(context, 0, &str, &var); hr = IWbemContext_Next(context, 0, &str, &var);
todo_wine todo_wine
ok(hr == WBEM_E_UNEXPECTED, "Unexpected hr %#x.\n", hr); ok(hr == WBEM_E_UNEXPECTED, "unexpected hr %#lx\n", hr);
hr = IWbemContext_BeginEnumeration(context, 0); hr = IWbemContext_BeginEnumeration(context, 0);
todo_wine todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "unexpected hr %#lx\n", hr);
str = NULL; str = NULL;
hr = IWbemContext_Next(context, 0, &str, &var); hr = IWbemContext_Next(context, 0, &str, &var);
todo_wine { todo_wine {
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "unexpected hr %#lx\n", hr);
ok(!lstrcmpW(str, L"name"), "Unexpected name %s.\n", wine_dbgstr_w(str)); ok(!lstrcmpW(str, L"name"), "unexpected name %s\n", wine_dbgstr_w(str));
SysFreeString(str); SysFreeString(str);
} }
hr = IWbemContext_EndEnumeration(context); hr = IWbemContext_EndEnumeration(context);
todo_wine todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "unexpected hr %#lx\n", hr);
/* Overwrite */ /* Overwrite */
V_VT(&var) = VT_I4; V_VT(&var) = VT_I4;
V_I4(&var) = 14; V_I4(&var) = 14;
hr = IWbemContext_SetValue(context, L"name", 0, &var); hr = IWbemContext_SetValue(context, L"name", 0, &var);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "unexpected hr %#lx\n", hr);
V_VT(&var) = VT_EMPTY; V_VT(&var) = VT_EMPTY;
hr = IWbemContext_GetValue(context, L"name", 0, &var); hr = IWbemContext_GetValue(context, L"name", 0, &var);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "unexpected hr %#lx\n", hr);
ok(V_VT(&var) == VT_I4, "Unexpected value type.\n"); ok(V_VT(&var) == VT_I4, "unexpected value type\n");
ok(V_I4(&var) == 14, "Unexpected value.\n"); ok(V_I4(&var) == 14, "unexpected value\n");
IWbemContext_Release( context ); IWbemContext_Release( context );
} }
...@@ -277,7 +275,7 @@ static void test_namespaces(void) ...@@ -277,7 +275,7 @@ static void test_namespaces(void)
{ {
resource = SysAllocString( tests[i].path ); resource = SysAllocString( tests[i].path );
hr = IWbemLocator_ConnectServer( locator, resource, NULL, NULL, NULL, 0, NULL, NULL, &services ); hr = IWbemLocator_ConnectServer( locator, resource, NULL, NULL, NULL, 0, NULL, NULL, &services );
ok( hr == S_OK || broken( tests[i].broken && hr == WBEM_E_INVALID_NAMESPACE ), "%u: got %08x\n", i, hr ); ok( hr == S_OK || broken( tests[i].broken && hr == WBEM_E_INVALID_NAMESPACE ), "%u: got %#lx\n", i, hr );
SysFreeString( resource ); SysFreeString( resource );
if (hr == S_OK) if (hr == S_OK)
IWbemServices_Release( services ); IWbemServices_Release( services );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment