Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
7fd01cf7
Commit
7fd01cf7
authored
2 years ago
by
Arek Hiler
Committed by
Alexandre Julliard
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
dinput/tests: Test GetObjectInfo() with three sliders and a proper format.
parent
101bf6c8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/dinput/tests/joystick8.c
+38
-0
38 additions, 0 deletions
dlls/dinput/tests/joystick8.c
with
38 additions
and
0 deletions
dlls/dinput/tests/joystick8.c
+
38
−
0
View file @
7fd01cf7
...
...
@@ -2596,6 +2596,28 @@ static BOOL test_device_types( DWORD version )
return
success
;
}
struct
three_sliders_state
{
LONG
slider
[
3
];
};
static
const
DIOBJECTDATAFORMAT
df_three_sliders
[]
=
{
{
&
GUID_Slider
,
FIELD_OFFSET
(
struct
three_sliders_state
,
slider
[
0
]),
DIDFT_OPTIONAL
|
DIDFT_AXIS
|
DIDFT_ANYINSTANCE
,
DIDOI_ASPECTPOSITION
},
{
&
GUID_Slider
,
FIELD_OFFSET
(
struct
three_sliders_state
,
slider
[
1
]),
DIDFT_OPTIONAL
|
DIDFT_AXIS
|
DIDFT_ANYINSTANCE
,
DIDOI_ASPECTPOSITION
},
{
&
GUID_Slider
,
FIELD_OFFSET
(
struct
three_sliders_state
,
slider
[
2
]),
DIDFT_OPTIONAL
|
DIDFT_AXIS
|
DIDFT_ANYINSTANCE
,
DIDOI_ASPECTPOSITION
},
};
static
const
DIDATAFORMAT
c_df_three_sliders
=
{
sizeof
(
DIDATAFORMAT
),
sizeof
(
DIOBJECTDATAFORMAT
),
DIDF_ABSAXIS
,
sizeof
(
struct
three_sliders_state
),
ARRAY_SIZE
(
df_three_sliders
),
(
DIOBJECTDATAFORMAT
*
)
df_three_sliders
,
};
static
void
test_many_axes_joystick
(
void
)
{
#include
"psh_hid_macros.h"
...
...
@@ -3070,6 +3092,22 @@ static void test_many_axes_joystick(void)
ok
(
hr
==
DI_OK
,
"GetObjectInfo returned: %#lx
\n
"
,
hr
);
check_object
(
&
objinst
,
&
expect_objects
[
16
],
&
todo_flags
);
/* make sure that we handle three sliders correctly when the format allows */
hr
=
IDirectInputDevice8_SetDataFormat
(
device
,
&
c_df_three_sliders
);
ok
(
hr
==
DI_OK
,
"SetDataFormat returned: %#lx
\n
"
,
hr
);
hr
=
IDirectInputDevice8_GetObjectInfo
(
device
,
&
objinst
,
offsetof
(
struct
three_sliders_state
,
slider
[
0
]),
DIPH_BYOFFSET
);
ok
(
hr
==
DI_OK
,
"GetObjectInfo returned: %#lx
\n
"
,
hr
);
check_object
(
&
objinst
,
&
expect_objects
[
6
],
NULL
);
hr
=
IDirectInputDevice8_GetObjectInfo
(
device
,
&
objinst
,
offsetof
(
struct
three_sliders_state
,
slider
[
1
]),
DIPH_BYOFFSET
);
ok
(
hr
==
DI_OK
,
"GetObjectInfo returned: %#lx
\n
"
,
hr
);
check_object
(
&
objinst
,
&
expect_objects
[
8
],
NULL
);
hr
=
IDirectInputDevice8_GetObjectInfo
(
device
,
&
objinst
,
offsetof
(
struct
three_sliders_state
,
slider
[
2
]),
DIPH_BYOFFSET
);
ok
(
hr
==
DI_OK
,
"GetObjectInfo returned: %#lx
\n
"
,
hr
);
check_object
(
&
objinst
,
&
expect_objects
[
9
],
NULL
);
ref
=
IDirectInputDevice8_Release
(
device
);
ok
(
ref
==
0
,
"Release returned %ld
\n
"
,
ref
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment