Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d1a6d70e
Commit
d1a6d70e
authored
Jul 14, 2011
by
Lucas Fialho Zawacki
Committed by
Alexandre Julliard
Jul 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput/tests: Tests for EnumObjects with different types of device objects.
parent
58bcc0ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
device.c
dlls/dinput/tests/device.c
+16
-0
No files found.
dlls/dinput/tests/device.c
View file @
d1a6d70e
...
...
@@ -64,11 +64,20 @@ static BOOL CALLBACK enum_callback(LPCDIDEVICEOBJECTINSTANCE oi, LPVOID info)
return
DIENUM_CONTINUE
;
}
static
BOOL
CALLBACK
enum_type_callback
(
LPCDIDEVICEOBJECTINSTANCE
oi
,
LPVOID
info
)
{
DWORD
expected
=
*
(
DWORD
*
)
info
;
ok
(
expected
&
DIDFT_GETTYPE
(
oi
->
dwType
),
"EnumObjects() enumerated wrong type for obj %s, expected: %08x got: %08x
\n
"
,
oi
->
tszName
,
expected
,
oi
->
dwType
);
return
DIENUM_CONTINUE
;
}
static
void
test_object_info
(
LPDIRECTINPUTDEVICE
device
,
HWND
hwnd
)
{
HRESULT
hr
;
DIPROPDWORD
dp
;
DIDEVICEOBJECTINSTANCE
obj_info
;
DWORD
obj_types
[]
=
{
DIDFT_BUTTON
,
DIDFT_AXIS
,
DIDFT_POV
};
int
type_index
;
int
cnt
=
0
,
cnt1
=
0
;
hr
=
IDirectInputDevice_EnumObjects
(
device
,
enum_callback
,
&
cnt
,
DIDFT_ALL
);
...
...
@@ -82,6 +91,13 @@ static void test_object_info(LPDIRECTINPUTDEVICE device, HWND hwnd)
if
(
0
)
/* fails for joystick only */
ok
(
cnt
==
cnt1
,
"Enum count changed from %d to %d
\n
"
,
cnt
,
cnt1
);
/* Testing EnumObjects with different types of device objects */
for
(
type_index
=
0
;
type_index
<
sizeof
(
obj_types
)
/
sizeof
(
obj_types
[
0
]);
type_index
++
)
{
hr
=
IDirectInputDevice_EnumObjects
(
device
,
enum_type_callback
,
&
obj_types
[
type_index
],
obj_types
[
type_index
]);
ok
(
SUCCEEDED
(
hr
),
"EnumObjects() failed: %08x
\n
"
,
hr
);
}
/* No need to test devices without axis */
obj_info
.
dwSize
=
sizeof
(
obj_info
);
hr
=
IDirectInputDevice_GetObjectInfo
(
device
,
&
obj_info
,
16
,
DIPH_BYOFFSET
);
...
...
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