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
50ae2547
Commit
50ae2547
authored
Sep 20, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput8/tests: Add some HID joystick IDirectInputDevice8_GetObjectInfo tests.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d47ec650
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
0 deletions
+91
-0
hid.c
dlls/dinput8/tests/hid.c
+91
-0
No files found.
dlls/dinput8/tests/hid.c
View file @
50ae2547
...
...
@@ -3627,6 +3627,7 @@ static void test_simple_joystick(void)
};
WCHAR
cwd
[
MAX_PATH
],
tempdir
[
MAX_PATH
];
DIDEVICEOBJECTDATA
objdata
[
32
]
=
{{
0
}};
DIDEVICEOBJECTINSTANCEW
objinst
=
{
0
};
DIDEVICEINSTANCEW
devinst
=
{
0
};
DIDATAFORMAT
dataformat
=
{
0
};
IDirectInputDevice8W
*
device
;
...
...
@@ -3921,6 +3922,74 @@ static void test_simple_joystick(void)
ok
(
check_objects_params
.
index
>=
check_objects_params
.
expect_count
,
"missing %u objects
\n
"
,
check_objects_params
.
expect_count
-
check_objects_params
.
index
);
hr
=
IDirectInputDevice8_GetObjectInfo
(
device
,
NULL
,
0
,
DIPH_DEVICE
);
ok
(
hr
==
E_POINTER
,
"IDirectInputDevice8_GetObjectInfo returned: %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_GetObjectInfo
(
device
,
&
objinst
,
0
,
DIPH_DEVICE
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice8_GetObjectInfo returned: %#x
\n
"
,
hr
);
objinst
.
dwSize
=
sizeof
(
DIDEVICEOBJECTINSTANCEW
);
hr
=
IDirectInputDevice8_GetObjectInfo
(
device
,
&
objinst
,
0
,
DIPH_DEVICE
);
todo_wine
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice8_GetObjectInfo returned: %#x
\n
"
,
hr
);
res
=
MAKELONG
(
HID_USAGE_GENERIC_Z
,
HID_USAGE_PAGE_GENERIC
);
hr
=
IDirectInputDevice8_GetObjectInfo
(
device
,
&
objinst
,
res
,
DIPH_BYUSAGE
);
todo_wine
ok
(
hr
==
DIERR_NOTFOUND
,
"IDirectInputDevice8_GetObjectInfo returned: %#x
\n
"
,
hr
);
res
=
MAKELONG
(
HID_USAGE_GENERIC_X
,
HID_USAGE_PAGE_GENERIC
);
hr
=
IDirectInputDevice8_GetObjectInfo
(
device
,
&
objinst
,
res
,
DIPH_BYUSAGE
);
ok
(
hr
==
DI_OK
,
"IDirectInputDevice8_GetObjectInfo returned: %#x
\n
"
,
hr
);
check_member
(
objinst
,
expect_objects
[
1
],
"%u"
,
dwSize
);
todo_wine
check_member_guid
(
objinst
,
expect_objects
[
1
],
guidType
);
check_member
(
objinst
,
expect_objects
[
1
],
"%#x"
,
dwOfs
);
check_member
(
objinst
,
expect_objects
[
1
],
"%#x"
,
dwType
);
check_member
(
objinst
,
expect_objects
[
1
],
"%#x"
,
dwFlags
);
if
(
!
localized
)
todo_wine
check_member_wstr
(
objinst
,
expect_objects
[
1
],
tszName
);
check_member
(
objinst
,
expect_objects
[
1
],
"%u"
,
dwFFMaxForce
);
check_member
(
objinst
,
expect_objects
[
1
],
"%u"
,
dwFFForceResolution
);
todo_wine
check_member
(
objinst
,
expect_objects
[
1
],
"%u"
,
wCollectionNumber
);
check_member
(
objinst
,
expect_objects
[
1
],
"%u"
,
wDesignatorIndex
);
check_member
(
objinst
,
expect_objects
[
1
],
"%#04x"
,
wUsagePage
);
todo_wine
check_member
(
objinst
,
expect_objects
[
1
],
"%#04x"
,
wUsage
);
check_member
(
objinst
,
expect_objects
[
1
],
"%#04x"
,
dwDimension
);
check_member
(
objinst
,
expect_objects
[
1
],
"%#04x"
,
wExponent
);
check_member
(
objinst
,
expect_objects
[
1
],
"%u"
,
wReportId
);
hr
=
IDirectInputDevice8_GetObjectInfo
(
device
,
&
objinst
,
0x14
,
DIPH_BYOFFSET
);
todo_wine
ok
(
hr
==
DIERR_NOTFOUND
,
"IDirectInputDevice8_GetObjectInfo returned: %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_GetObjectInfo
(
device
,
&
objinst
,
0
,
DIPH_BYOFFSET
);
todo_wine
ok
(
hr
==
DIERR_NOTFOUND
,
"IDirectInputDevice8_GetObjectInfo returned: %#x
\n
"
,
hr
);
res
=
DIDFT_PSHBUTTON
|
DIDFT_MAKEINSTANCE
(
3
);
hr
=
IDirectInputDevice8_GetObjectInfo
(
device
,
&
objinst
,
res
,
DIPH_BYID
);
todo_wine
ok
(
hr
==
DIERR_NOTFOUND
,
"IDirectInputDevice8_GetObjectInfo returned: %#x
\n
"
,
hr
);
res
=
DIDFT_PSHBUTTON
|
DIDFT_MAKEINSTANCE
(
1
);
hr
=
IDirectInputDevice8_GetObjectInfo
(
device
,
&
objinst
,
res
,
DIPH_BYID
);
ok
(
hr
==
DI_OK
,
"IDirectInputDevice8_GetObjectInfo returned: %#x
\n
"
,
hr
);
check_member
(
objinst
,
expect_objects
[
4
],
"%u"
,
dwSize
);
check_member_guid
(
objinst
,
expect_objects
[
4
],
guidType
);
todo_wine
check_member
(
objinst
,
expect_objects
[
4
],
"%#x"
,
dwOfs
);
check_member
(
objinst
,
expect_objects
[
4
],
"%#x"
,
dwType
);
check_member
(
objinst
,
expect_objects
[
4
],
"%#x"
,
dwFlags
);
if
(
!
localized
)
todo_wine
check_member_wstr
(
objinst
,
expect_objects
[
4
],
tszName
);
check_member
(
objinst
,
expect_objects
[
4
],
"%u"
,
dwFFMaxForce
);
check_member
(
objinst
,
expect_objects
[
4
],
"%u"
,
dwFFForceResolution
);
todo_wine
check_member
(
objinst
,
expect_objects
[
4
],
"%u"
,
wCollectionNumber
);
check_member
(
objinst
,
expect_objects
[
4
],
"%u"
,
wDesignatorIndex
);
check_member
(
objinst
,
expect_objects
[
4
],
"%#04x"
,
wUsagePage
);
check_member
(
objinst
,
expect_objects
[
4
],
"%#04x"
,
wUsage
);
check_member
(
objinst
,
expect_objects
[
4
],
"%#04x"
,
dwDimension
);
check_member
(
objinst
,
expect_objects
[
4
],
"%#04x"
,
wExponent
);
check_member
(
objinst
,
expect_objects
[
4
],
"%u"
,
wReportId
);
hr
=
IDirectInputDevice8_SetDataFormat
(
device
,
NULL
);
ok
(
hr
==
E_POINTER
,
"IDirectInputDevice8_SetDataFormat returned: %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_SetDataFormat
(
device
,
&
dataformat
);
...
...
@@ -3935,6 +4004,28 @@ static void test_simple_joystick(void)
hr
=
IDirectInputDevice8_SetDataFormat
(
device
,
&
c_dfDIJoystick2
);
ok
(
hr
==
DI_OK
,
"IDirectInputDevice8_SetDataFormat returned: %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_GetObjectInfo
(
device
,
&
objinst
,
DIJOFS_Y
,
DIPH_BYOFFSET
);
ok
(
hr
==
DI_OK
,
"IDirectInputDevice8_GetObjectInfo returned: %#x
\n
"
,
hr
);
check_member
(
objinst
,
expect_objects
[
0
],
"%u"
,
dwSize
);
check_member_guid
(
objinst
,
expect_objects
[
0
],
guidType
);
todo_wine
check_member
(
objinst
,
expect_objects
[
0
],
"%#x"
,
dwOfs
);
todo_wine
check_member
(
objinst
,
expect_objects
[
0
],
"%#x"
,
dwType
);
check_member
(
objinst
,
expect_objects
[
0
],
"%#x"
,
dwFlags
);
if
(
!
localized
)
todo_wine
check_member_wstr
(
objinst
,
expect_objects
[
0
],
tszName
);
check_member
(
objinst
,
expect_objects
[
0
],
"%u"
,
dwFFMaxForce
);
check_member
(
objinst
,
expect_objects
[
0
],
"%u"
,
dwFFForceResolution
);
todo_wine
check_member
(
objinst
,
expect_objects
[
0
],
"%u"
,
wCollectionNumber
);
check_member
(
objinst
,
expect_objects
[
0
],
"%u"
,
wDesignatorIndex
);
check_member
(
objinst
,
expect_objects
[
0
],
"%#04x"
,
wUsagePage
);
check_member
(
objinst
,
expect_objects
[
0
],
"%#04x"
,
wUsage
);
check_member
(
objinst
,
expect_objects
[
0
],
"%#04x"
,
dwDimension
);
check_member
(
objinst
,
expect_objects
[
0
],
"%#04x"
,
wExponent
);
check_member
(
objinst
,
expect_objects
[
0
],
"%u"
,
wReportId
);
hr
=
IDirectInputDevice8_SetEventNotification
(
device
,
(
HANDLE
)
0xdeadbeef
);
todo_wine
ok
(
hr
==
E_HANDLE
,
"IDirectInputDevice8_SetEventNotification returned: %#x
\n
"
,
hr
);
...
...
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