wbemprox/tests: Build without -DWINE_NO_LONG_TYPES.
Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0444be5ccd
commit
ce22a02564
|
@ -1,4 +1,3 @@
|
|||
EXTRADEFS = -DWINE_NO_LONG_TYPES
|
||||
TESTDLL = wbemprox.dll
|
||||
IMPORTS = uuid oleaut32 ole32 user32 advapi32
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -30,7 +30,7 @@ static void _expect_ref(IUnknown* obj, ULONG ref, int line)
|
|||
ULONG rc;
|
||||
IUnknown_AddRef(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)
|
||||
|
@ -48,45 +48,45 @@ static void test_IClientSecurity(void)
|
|||
win_skip("can't create instance of WbemLocator\n");
|
||||
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 );
|
||||
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 );
|
||||
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 );
|
||||
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 );
|
||||
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 );
|
||||
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 );
|
||||
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" );
|
||||
|
||||
refs = IClientSecurity_Release( security );
|
||||
ok( refs == 1, "unexpected refcount %u\n", refs );
|
||||
ok( refs == 1, "unexpected refcount %lu\n", refs );
|
||||
|
||||
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 );
|
||||
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 );
|
||||
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" );
|
||||
|
||||
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 );
|
||||
todo_wine ok( refs == 0, "unexpected refcount %u\n", refs );
|
||||
todo_wine ok( refs == 0, "unexpected refcount %lu\n", refs );
|
||||
|
||||
IWbemLocator_Release( locator );
|
||||
SysFreeString( path );
|
||||
|
@ -144,7 +144,7 @@ static void test_IWbemLocator(void)
|
|||
win_skip("can't create instance of WbemLocator\n");
|
||||
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++)
|
||||
{
|
||||
|
@ -152,24 +152,22 @@ static void test_IWbemLocator(void)
|
|||
hr = IWbemLocator_ConnectServer( locator, resource, NULL, NULL, NULL, 0, NULL, NULL, &services );
|
||||
todo_wine_if (test[i].todo)
|
||||
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 );
|
||||
if (hr == S_OK) IWbemServices_Release( services );
|
||||
}
|
||||
|
||||
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);
|
||||
resource = SysAllocString( L"root\\default" );
|
||||
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 );
|
||||
EXPECT_REF(context, 1);
|
||||
IWbemServices_Release( services );
|
||||
|
||||
IWbemContext_Release( context );
|
||||
|
||||
IWbemLocator_Release( locator );
|
||||
}
|
||||
|
||||
|
@ -181,68 +179,68 @@ static void test_IWbemContext(void)
|
|||
BSTR str;
|
||||
|
||||
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);
|
||||
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_I4(&var) = 12;
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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;
|
||||
hr = IWbemContext_GetValue(context, L"NAME", 0, &var);
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
ok(V_VT(&var) == VT_I4, "Unexpected value type.\n");
|
||||
ok(hr == S_OK, "unexpected hr %#lx\n", hr);
|
||||
ok(V_VT(&var) == VT_I4, "unexpected value type\n");
|
||||
|
||||
V_VT(&var) = VT_I4;
|
||||
V_I4(&var) = 13;
|
||||
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);
|
||||
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);
|
||||
todo_wine
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "unexpected hr %#lx\n", hr);
|
||||
|
||||
str = NULL;
|
||||
hr = IWbemContext_Next(context, 0, &str, &var);
|
||||
todo_wine {
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
ok(!lstrcmpW(str, L"name"), "Unexpected name %s.\n", wine_dbgstr_w(str));
|
||||
ok(hr == S_OK, "unexpected hr %#lx\n", hr);
|
||||
ok(!lstrcmpW(str, L"name"), "unexpected name %s\n", wine_dbgstr_w(str));
|
||||
SysFreeString(str);
|
||||
}
|
||||
hr = IWbemContext_EndEnumeration(context);
|
||||
todo_wine
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "unexpected hr %#lx\n", hr);
|
||||
|
||||
/* Overwrite */
|
||||
V_VT(&var) = VT_I4;
|
||||
V_I4(&var) = 14;
|
||||
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;
|
||||
hr = IWbemContext_GetValue(context, L"name", 0, &var);
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
ok(V_VT(&var) == VT_I4, "Unexpected value type.\n");
|
||||
ok(V_I4(&var) == 14, "Unexpected value.\n");
|
||||
ok(hr == S_OK, "unexpected hr %#lx\n", hr);
|
||||
ok(V_VT(&var) == VT_I4, "unexpected value type\n");
|
||||
ok(V_I4(&var) == 14, "unexpected value\n");
|
||||
|
||||
IWbemContext_Release( context );
|
||||
}
|
||||
|
@ -277,7 +275,7 @@ static void test_namespaces(void)
|
|||
{
|
||||
resource = SysAllocString( tests[i].path );
|
||||
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 );
|
||||
if (hr == S_OK)
|
||||
IWbemServices_Release( services );
|
||||
|
|
Loading…
Reference in New Issue