Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
151f3fc2
Commit
151f3fc2
authored
Mar 02, 2018
by
Hans Leidekker
Committed by
Alexandre Julliard
Mar 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemprox/tests: Add tests for Win32_Printer.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
be9758f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
+66
-0
query.c
dlls/wbemprox/tests/query.c
+66
-0
No files found.
dlls/wbemprox/tests/query.c
View file @
151f3fc2
...
...
@@ -1641,6 +1641,71 @@ static void test_Win32_VideoController( IWbemServices *services )
SysFreeString
(
wql
);
}
static
void
test_Win32_Printer
(
IWbemServices
*
services
)
{
static
const
WCHAR
deviceidW
[]
=
{
'D'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'I'
,
'd'
,
0
};
static
const
WCHAR
locationW
[]
=
{
'L'
,
'o'
,
'c'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
portnameW
[]
=
{
'P'
,
'o'
,
'r'
,
't'
,
'N'
,
'a'
,
'm'
,
'e'
,
0
};
static
const
WCHAR
queryW
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'W'
,
'i'
,
'n'
,
'3'
,
'2'
,
'_'
,
'P'
,
'r'
,
'i'
,
'n'
,
't'
,
'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_Printer not available
\n
"
);
return
;
}
for
(;;)
{
hr
=
IEnumWbemClassObject_Next
(
result
,
10000
,
1
,
&
obj
,
&
count
);
if
(
hr
!=
S_OK
)
break
;
type
=
0xdeadbeef
;
memset
(
&
val
,
0
,
sizeof
(
val
)
);
hr
=
IWbemClassObject_Get
(
obj
,
deviceidW
,
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
(
"deviceid %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
val
))
);
VariantClear
(
&
val
);
type
=
0xdeadbeef
;
memset
(
&
val
,
0
,
sizeof
(
val
)
);
hr
=
IWbemClassObject_Get
(
obj
,
locationW
,
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
(
"location %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
val
))
);
VariantClear
(
&
val
);
type
=
0xdeadbeef
;
memset
(
&
val
,
0
,
sizeof
(
val
)
);
hr
=
IWbemClassObject_Get
(
obj
,
portnameW
,
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
(
"portname %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
};
...
...
@@ -1684,6 +1749,7 @@ START_TEST(query)
test_Win32_IP4RouteTable
(
services
);
test_Win32_Processor
(
services
);
test_Win32_VideoController
(
services
);
test_Win32_Printer
(
services
);
SysFreeString
(
path
);
IWbemServices_Release
(
services
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment