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
2656e418
Commit
2656e418
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_USERNAME property.
parent
88e2b447
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
1 deletion
+49
-1
joystick8.c
dlls/dinput/tests/joystick8.c
+49
-1
No files found.
dlls/dinput/tests/joystick8.c
View file @
2656e418
...
...
@@ -725,11 +725,29 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
{.
objid
=
TRUE
},
{.
objid
=
TRUE
,
.
how
=
TRUE
},
};
DIPROPSTRING
prop_username
=
{
.
diph
=
{
.
dwHeaderSize
=
sizeof
(
DIPROPHEADER
),
.
dwSize
=
sizeof
(
DIPROPSTRING
),
.
dwHow
=
DIPH_DEVICE
,
}
};
DIACTIONW
actions
[
ARRAY_SIZE
(
expect_actions
)];
DIACTIONFORMATW
action_format
;
DWORD
flags
;
WCHAR
username
[
256
];
DWORD
res
,
flags
;
HRESULT
hr
;
res
=
ARRAY_SIZE
(
username
);
GetUserNameW
(
username
,
&
res
);
memset
(
prop_username
.
wsz
,
0
,
sizeof
(
prop_username
.
wsz
)
);
hr
=
IDirectInputDevice_GetProperty
(
device
,
DIPROP_USERNAME
,
&
prop_username
.
diph
);
ok
(
hr
==
DI_NOEFFECT
,
"GetProperty returned %#lx
\n
"
,
hr
);
ok
(
!
wcscmp
(
prop_username
.
wsz
,
L""
),
"got username %s
\n
"
,
debugstr_w
(
prop_username
.
wsz
)
);
hr
=
IDirectInputDevice8_BuildActionMap
(
device
,
NULL
,
L"username"
,
DIDBAM_DEFAULT
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"BuildActionMap returned %#lx
\n
"
,
hr
);
...
...
@@ -768,12 +786,26 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
todo_wine
ok
(
hr
==
DI_SETTINGSNOTSAVED
,
"SetActionMap returned %#lx
\n
"
,
hr
);
memset
(
prop_username
.
wsz
,
0
,
sizeof
(
prop_username
.
wsz
)
);
hr
=
IDirectInputDevice_GetProperty
(
device
,
DIPROP_USERNAME
,
&
prop_username
.
diph
);
todo_wine
ok
(
hr
==
DI_OK
,
"GetProperty returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
!
wcscmp
(
prop_username
.
wsz
,
username
),
"got username %s
\n
"
,
debugstr_w
(
prop_username
.
wsz
)
);
hr
=
IDirectInputDevice8_SetActionMap
(
device
,
&
voice_action_format
,
NULL
,
DIDSAM_DEFAULT
);
ok
(
hr
==
DI_NOEFFECT
,
"SetActionMap returned %#lx
\n
"
,
hr
);
hr
=
IDirectInputDevice8_SetActionMap
(
device
,
&
voice_action_format
,
NULL
,
DIDSAM_FORCESAVE
);
todo_wine
ok
(
hr
==
DI_SETTINGSNOTSAVED
,
"SetActionMap returned %#lx
\n
"
,
hr
);
memset
(
prop_username
.
wsz
,
0
,
sizeof
(
prop_username
.
wsz
)
);
hr
=
IDirectInputDevice_GetProperty
(
device
,
DIPROP_USERNAME
,
&
prop_username
.
diph
);
todo_wine
ok
(
hr
==
DI_OK
,
"GetProperty returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
!
wcscmp
(
prop_username
.
wsz
,
username
),
"got username %s
\n
"
,
debugstr_w
(
prop_username
.
wsz
)
);
action_format
=
action_format_1
;
action_format
.
rgoAction
=
actions
;
...
...
@@ -891,6 +923,22 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
hr
=
IDirectInputDevice8_BuildActionMap
(
device
,
&
action_format
,
L"username"
,
DIDBAM_PRESERVE
);
ok
(
hr
==
DI_OK
,
"BuildActionMap returned %#lx
\n
"
,
hr
);
check_diactionformatw_
(
__LINE__
,
&
action_format
,
&
expect_action_format_2
,
actions_todos_2
);
/* DIDSAM_NOUSER flag clears the device user property */
memset
(
prop_username
.
wsz
,
0
,
sizeof
(
prop_username
.
wsz
)
);
hr
=
IDirectInputDevice_GetProperty
(
device
,
DIPROP_USERNAME
,
&
prop_username
.
diph
);
ok
(
hr
==
DI_OK
,
"GetProperty returned %#lx
\n
"
,
hr
);
ok
(
!
wcscmp
(
prop_username
.
wsz
,
L"username"
),
"got username %s
\n
"
,
debugstr_w
(
prop_username
.
wsz
)
);
hr
=
IDirectInputDevice8_SetActionMap
(
device
,
&
action_format
,
L"username"
,
DIDSAM_NOUSER
);
ok
(
hr
==
DI_OK
,
"SetActionMap returned %#lx
\n
"
,
hr
);
memset
(
prop_username
.
wsz
,
0
,
sizeof
(
prop_username
.
wsz
)
);
hr
=
IDirectInputDevice_GetProperty
(
device
,
DIPROP_USERNAME
,
&
prop_username
.
diph
);
ok
(
hr
==
DI_NOEFFECT
,
"GetProperty returned %#lx
\n
"
,
hr
);
ok
(
!
wcscmp
(
prop_username
.
wsz
,
L""
),
"got username %s
\n
"
,
debugstr_w
(
prop_username
.
wsz
)
);
}
static
void
test_simple_joystick
(
DWORD
version
)
...
...
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