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
87744a57
Commit
87744a57
authored
Nov 21, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput/tests: Add more HidP_(Set|Get)UsageValue tests with array caps.
parent
4c02d8e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
7 deletions
+31
-7
hid.c
dlls/dinput/tests/hid.c
+31
-7
No files found.
dlls/dinput/tests/hid.c
View file @
87744a57
...
...
@@ -1543,7 +1543,7 @@ static void test_hidp( HANDLE file, HANDLE async_file, int report_id, BOOL polle
.
LinkUsagePage
=
HID_USAGE_PAGE_GENERIC
,
.
LinkCollection
=
1
,
.
IsAbsolute
=
TRUE
,
.
BitSize
=
4
,
.
BitSize
=
2
4
,
.
ReportCount
=
2
,
.
LogicalMin
=
1
,
.
LogicalMax
=
8
,
...
...
@@ -1792,26 +1792,50 @@ static void test_hidp( HANDLE file, HANDLE async_file, int report_id, BOOL polle
status
=
HidP_SetUsageValueArray
(
HidP_Input
,
HID_USAGE_PAGE_GENERIC
,
0
,
HID_USAGE_GENERIC_X
,
buffer
,
sizeof
(
buffer
),
preparsed_data
,
report
,
caps
.
InputReportByteLength
);
ok
(
status
==
HIDP_STATUS_NOT_VALUE_ARRAY
,
"HidP_SetUsageValueArray returned %#lx
\n
"
,
status
);
memset
(
buffer
,
0x
cd
,
sizeof
(
buffer
)
);
memset
(
buffer
,
0x
a5
,
sizeof
(
buffer
)
);
status
=
HidP_SetUsageValueArray
(
HidP_Input
,
HID_USAGE_PAGE_GENERIC
,
0
,
HID_USAGE_GENERIC_HATSWITCH
,
buffer
,
0
,
preparsed_data
,
report
,
caps
.
InputReportByteLength
);
ok
(
status
==
HIDP_STATUS_BUFFER_TOO_SMALL
,
"HidP_SetUsageValueArray returned %#lx
\n
"
,
status
);
status
=
HidP_SetUsageValueArray
(
HidP_Input
,
HID_USAGE_PAGE_GENERIC
,
0
,
HID_USAGE_GENERIC_HATSWITCH
,
buffer
,
8
,
preparsed_data
,
report
,
caps
.
InputReportByteLength
);
ok
(
status
==
HIDP_STATUS_SUCCESS
,
"HidP_SetUsageValueArray returned %#lx
\n
"
,
status
);
ok
(
report
[
16
]
==
(
char
)
0xa5
,
"got report value %d
\n
"
,
report
[
16
]
);
ok
(
report
[
17
]
==
(
char
)
0xa5
,
"got report value %d
\n
"
,
report
[
17
]
);
report
[
16
]
=
0xa5
;
report
[
17
]
=
0xa5
;
status
=
HidP_SetUsageValue
(
HidP_Input
,
HID_USAGE_PAGE_GENERIC
,
0
,
HID_USAGE_GENERIC_HATSWITCH
,
8
,
preparsed_data
,
report
,
caps
.
InputReportByteLength
);
todo_wine
ok
(
status
==
HIDP_STATUS_SUCCESS
,
"HidP_SetUsageValue returned %#lx
\n
"
,
status
);
todo_wine
ok
(
report
[
16
]
==
(
char
)
8
,
"got value %#x
\n
"
,
report
[
16
]
);
todo_wine
ok
(
status
==
HIDP_STATUS_NOT_IMPLEMENTED
,
"HidP_SetUsageValueArray returned %#lx
\n
"
,
status
);
ok
(
report
[
17
]
==
(
char
)
0
,
"got value %#x
\n
"
,
report
[
17
]
);
status
=
HidP_GetUsageValueArray
(
HidP_Input
,
HID_USAGE_PAGE_GENERIC
,
0
,
HID_USAGE_GENERIC_X
,
buffer
,
sizeof
(
buffer
),
preparsed_data
,
report
,
caps
.
InputReportByteLength
);
ok
(
status
==
HIDP_STATUS_NOT_VALUE_ARRAY
,
"HidP_GetUsageValueArray returned %#lx
\n
"
,
status
);
memset
(
buffer
,
0x
cd
,
sizeof
(
buffer
)
);
memset
(
buffer
,
0x
a5
,
sizeof
(
buffer
)
);
status
=
HidP_GetUsageValueArray
(
HidP_Input
,
HID_USAGE_PAGE_GENERIC
,
0
,
HID_USAGE_GENERIC_HATSWITCH
,
buffer
,
0
,
preparsed_data
,
report
,
caps
.
InputReportByteLength
);
ok
(
status
==
HIDP_STATUS_BUFFER_TOO_SMALL
,
"HidP_GetUsageValueArray returned %#lx
\n
"
,
status
);
report
[
16
]
=
0xcd
;
report
[
17
]
=
0xcd
;
status
=
HidP_GetUsageValueArray
(
HidP_Input
,
HID_USAGE_PAGE_GENERIC
,
0
,
HID_USAGE_GENERIC_HATSWITCH
,
buffer
,
8
,
preparsed_data
,
report
,
caps
.
InputReportByteLength
);
ok
(
status
==
HIDP_STATUS_SUCCESS
,
"HidP_GetUsageValueArray returned %#lx
\n
"
,
status
);
ok
(
buffer
[
0
]
==
(
char
)
0xcd
,
"got report value %#x
\n
"
,
buffer
[
0
]
);
ok
(
buffer
[
1
]
==
(
char
)
0xcd
,
"got report value %#x
\n
"
,
buffer
[
1
]
);
report
[
16
]
=
0xff
;
report
[
17
]
=
0xff
;
status
=
HidP_GetUsageValue
(
HidP_Input
,
HID_USAGE_PAGE_GENERIC
,
0
,
HID_USAGE_GENERIC_HATSWITCH
,
&
value
,
preparsed_data
,
report
,
caps
.
InputReportByteLength
);
todo_wine
ok
(
status
==
HIDP_STATUS_SUCCESS
,
"HidP_GetUsageValue returned %#lx
\n
"
,
status
);
todo_wine
ok
(
status
==
HIDP_STATUS_NOT_IMPLEMENTED
,
"HidP_GetUsageValueArray returned %#lx
\n
"
,
status
);
ok
(
value
==
0xffff
,
"got value %ld
\n
"
,
value
);
value
=
-
128
;
status
=
HidP_SetUsageValue
(
HidP_Input
,
HID_USAGE_PAGE_GENERIC
,
0
,
HID_USAGE_GENERIC_X
,
value
,
...
...
@@ -2787,7 +2811,7 @@ static void test_hid_driver( DWORD report_id, DWORD polled )
USAGE
(
1
,
HID_USAGE_GENERIC_HATSWITCH
),
LOGICAL_MINIMUM
(
1
,
1
),
LOGICAL_MAXIMUM
(
1
,
8
),
REPORT_SIZE
(
1
,
4
),
REPORT_SIZE
(
1
,
2
4
),
REPORT_COUNT
(
1
,
2
),
INPUT
(
1
,
Data
|
Var
|
Abs
),
...
...
@@ -2989,7 +3013,7 @@ static void test_hid_driver( DWORD report_id, DWORD polled )
{
.
Usage
=
HID_USAGE_GENERIC_JOYSTICK
,
.
UsagePage
=
HID_USAGE_PAGE_GENERIC
,
.
InputReportByteLength
=
report_id
?
3
2
:
33
,
.
InputReportByteLength
=
report_id
?
3
7
:
38
,
.
OutputReportByteLength
=
report_id
?
2
:
3
,
.
FeatureReportByteLength
=
report_id
?
31
:
32
,
.
NumberLinkCollectionNodes
=
11
,
...
...
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