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

wbemprox/tests: Add tests for Win32_VideoController.

parent 854482c3
......@@ -1556,6 +1556,81 @@ static void test_Win32_Processor( IWbemServices *services )
SysFreeString( wql );
}
static void test_Win32_VideoController( IWbemServices *services )
{
static const WCHAR configmanagererrorcodeW[] =
{'C','o','n','f','i','g','M','a','n','a','g','e','r','E','r','r','o','r','C','o','d','e',0};
static const WCHAR driverdateW[] =
{'D','r','i','v','e','r','D','a','t','e',0};
static const WCHAR installeddisplaydriversW[]=
{'I','n','s','t','a','l','l','e','d','D','i','s','p','l','a','y','D','r','i','v','e','r','s',0};
static const WCHAR statusW[] =
{'S','t','a','t','u','s',0};
static const WCHAR queryW[] =
{'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_',
'V','i','d','e','o','C','o','n','t','r','o','l','l','e','r',0};
BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW );
IEnumWbemClassObject *result;
IWbemClassObject *obj;
VARIANT val;
CIMTYPE type;
HRESULT hr;
DWORD count;
hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result );
if (hr != S_OK)
{
win_skip( "Win32_VideoController not available\n" );
return;
}
for (;;)
{
hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count );
if (hr != S_OK) break;
type = 0xdeadbeef;
VariantInit( &val );
hr = IWbemClassObject_Get( obj, configmanagererrorcodeW, 0, &val, &type, NULL );
ok( hr == S_OK, "got %08x\n", hr );
ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) );
ok( type == CIM_UINT32, "unexpected type 0x%x\n", type );
trace( "configmanagererrorcode %d\n", V_I4( &val ) );
type = 0xdeadbeef;
VariantInit( &val );
hr = IWbemClassObject_Get( obj, driverdateW, 0, &val, &type, NULL );
ok( hr == S_OK, "got %08x\n", hr );
ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) );
ok( type == CIM_DATETIME, "unexpected type 0x%x\n", type );
trace( "driverdate %s\n", wine_dbgstr_w(V_BSTR( &val )) );
VariantClear( &val );
type = 0xdeadbeef;
VariantInit( &val );
hr = IWbemClassObject_Get( obj, installeddisplaydriversW, 0, &val, &type, NULL );
ok( hr == S_OK, "got %08x\n", hr );
ok( V_VT( &val ) == VT_BSTR || V_VT( &val ) == VT_NULL, "unexpected variant type 0x%x\n", V_VT( &val ) );
ok( type == CIM_STRING, "unexpected type 0x%x\n", type );
trace( "installeddisplaydrivers %s\n", wine_dbgstr_w(V_BSTR( &val )) );
VariantClear( &val );
type = 0xdeadbeef;
VariantInit( &val );
hr = IWbemClassObject_Get( obj, statusW, 0, &val, &type, NULL );
ok( hr == S_OK, "got %08x\n", hr );
ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) );
ok( type == CIM_STRING, "unexpected type 0x%x\n", type );
trace( "status %s\n", wine_dbgstr_w(V_BSTR( &val )) );
VariantClear( &val );
IWbemClassObject_Release( obj );
}
SysFreeString( query );
SysFreeString( wql );
}
START_TEST(query)
{
static const WCHAR cimv2W[] = {'R','O','O','T','\\','C','I','M','V','2',0};
......@@ -1598,6 +1673,7 @@ START_TEST(query)
test_PhysicalMemory( services );
test_IP4RouteTable( services );
test_Win32_Processor( services );
test_Win32_VideoController( services );
SysFreeString( path );
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