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
2750d924
Commit
2750d924
authored
Mar 16, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput/tests: Test SaveActionMap effect on DIPROP_APPDATA property.
parent
2656e418
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
+66
-0
joystick8.c
dlls/dinput/tests/joystick8.c
+66
-0
No files found.
dlls/dinput/tests/joystick8.c
View file @
2750d924
...
...
@@ -734,6 +734,14 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
.
dwHow
=
DIPH_DEVICE
,
}
};
DIPROPPOINTER
prop_pointer
=
{
.
diph
=
{
.
dwHeaderSize
=
sizeof
(
DIPROPHEADER
),
.
dwSize
=
sizeof
(
DIPROPPOINTER
),
}
};
DIACTIONW
actions
[
ARRAY_SIZE
(
expect_actions
)];
DIACTIONFORMATW
action_format
;
WCHAR
username
[
256
];
...
...
@@ -885,6 +893,14 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
ok
(
hr
==
DI_OK
,
"SetActionMap returned %#lx
\n
"
,
hr
);
prop_pointer
.
diph
.
dwHow
=
DIPH_BYUSAGE
;
prop_pointer
.
diph
.
dwObj
=
MAKELONG
(
HID_USAGE_GENERIC_X
,
HID_USAGE_PAGE_GENERIC
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_APPDATA
,
&
prop_pointer
.
diph
);
todo_wine
ok
(
hr
==
DI_OK
,
"GetProperty returned %#lx
\n
"
,
hr
);
ok
(
prop_pointer
.
uData
==
0
,
"got uData %#Ix
\n
"
,
prop_pointer
.
uData
);
/* saving action map actually does nothing */
action_format
=
action_format_2_filled
;
...
...
@@ -903,6 +919,34 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
check_diactionformatw_
(
__LINE__
,
&
action_format
,
&
expect_action_format_2_filled
,
actions_todos_2_filled
);
prop_pointer
.
diph
.
dwHow
=
DIPH_DEVICE
;
prop_pointer
.
diph
.
dwObj
=
0
;
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_APPDATA
,
&
prop_pointer
.
diph
);
ok
(
hr
==
DIERR_UNSUPPORTED
,
"GetProperty returned %#lx
\n
"
,
hr
);
prop_pointer
.
diph
.
dwHow
=
DIPH_BYID
;
prop_pointer
.
diph
.
dwObj
=
DIDFT_ABSAXIS
|
DIDFT_MAKEINSTANCE
(
3
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_APPDATA
,
&
prop_pointer
.
diph
);
todo_wine
ok
(
hr
==
DIERR_NOTFOUND
,
"GetProperty returned %#lx
\n
"
,
hr
);
prop_pointer
.
diph
.
dwHow
=
DIPH_BYID
;
prop_pointer
.
diph
.
dwObj
=
DIDFT_ABSAXIS
|
DIDFT_MAKEINSTANCE
(
2
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_APPDATA
,
&
prop_pointer
.
diph
);
todo_wine
ok
(
hr
==
DI_OK
,
"GetProperty returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
prop_pointer
.
uData
==
6
,
"got uData %#Ix
\n
"
,
prop_pointer
.
uData
);
prop_pointer
.
diph
.
dwHow
=
DIPH_BYUSAGE
;
prop_pointer
.
diph
.
dwObj
=
MAKELONG
(
HID_USAGE_GENERIC_X
,
HID_USAGE_PAGE_GENERIC
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_APPDATA
,
&
prop_pointer
.
diph
);
todo_wine
ok
(
hr
==
DI_OK
,
"GetProperty returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
prop_pointer
.
uData
==
8
,
"got uData %#Ix
\n
"
,
prop_pointer
.
uData
);
action_format
=
action_format_2
;
action_format
.
rgoAction
=
actions
;
memcpy
(
actions
,
default_actions
,
sizeof
(
default_actions
)
);
...
...
@@ -925,6 +969,28 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
check_diactionformatw_
(
__LINE__
,
&
action_format
,
&
expect_action_format_2
,
actions_todos_2
);
/* setting the data format resets action map */
prop_pointer
.
diph
.
dwHow
=
DIPH_BYUSAGE
;
prop_pointer
.
diph
.
dwObj
=
MAKELONG
(
HID_USAGE_GENERIC_X
,
HID_USAGE_PAGE_GENERIC
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_APPDATA
,
&
prop_pointer
.
diph
);
todo_wine
ok
(
hr
==
DI_OK
,
"GetProperty returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
prop_pointer
.
uData
==
8
,
"got uData %#Ix
\n
"
,
prop_pointer
.
uData
);
hr
=
IDirectInputDevice8_SetDataFormat
(
device
,
&
c_dfDIJoystick2
);
ok
(
hr
==
DI_OK
,
"SetDataFormat returned %#lx
\n
"
,
hr
);
prop_pointer
.
diph
.
dwHow
=
DIPH_BYUSAGE
;
prop_pointer
.
diph
.
dwObj
=
MAKELONG
(
HID_USAGE_GENERIC_X
,
HID_USAGE_PAGE_GENERIC
);
hr
=
IDirectInputDevice8_GetProperty
(
device
,
DIPROP_APPDATA
,
&
prop_pointer
.
diph
);
todo_wine
ok
(
hr
==
DI_OK
,
"GetProperty returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
prop_pointer
.
uData
==
-
1
,
"got uData %#Ix
\n
"
,
prop_pointer
.
uData
);
/* DIDSAM_NOUSER flag clears the device user property */
memset
(
prop_username
.
wsz
,
0
,
sizeof
(
prop_username
.
wsz
)
);
...
...
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