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
2c54c3dc
Commit
2c54c3dc
authored
Jan 01, 2009
by
Andrew Fenn
Committed by
Alexandre Julliard
Jan 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xinput1_3: Added tests for XInputSetState.
parent
2e71742d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
xinput.c
dlls/xinput1_3/tests/xinput.c
+34
-0
No files found.
dlls/xinput1_3/tests/xinput.c
View file @
2c54c3dc
...
...
@@ -25,6 +25,37 @@
static
DWORD
(
WINAPI
*
pXInputGetState
)(
DWORD
,
XINPUT_STATE
*
);
static
DWORD
(
WINAPI
*
pXInputGetCapabilities
)(
DWORD
,
DWORD
,
XINPUT_CAPABILITIES
*
);
static
DWORD
(
WINAPI
*
pXInputSetState
)(
DWORD
,
XINPUT_VIBRATION
*
);
static
void
(
WINAPI
*
pXInputEnable
)(
BOOL
);
static
void
test_set_state
(
void
)
{
XINPUT_VIBRATION
vibrator
;
DWORD
controllerNum
;
DWORD
result
;
for
(
controllerNum
=
0
;
controllerNum
<
XUSER_MAX_COUNT
;
controllerNum
++
)
{
ZeroMemory
(
&
vibrator
,
sizeof
(
XINPUT_VIBRATION
));
vibrator
.
wLeftMotorSpeed
=
0
;
vibrator
.
wRightMotorSpeed
=
0
;
result
=
pXInputSetState
(
controllerNum
,
&
vibrator
);
ok
(
result
==
ERROR_SUCCESS
||
result
==
ERROR_DEVICE_NOT_CONNECTED
,
"XInputSetState failed with (%d)
\n
"
,
result
);
pXInputEnable
(
0
);
vibrator
.
wLeftMotorSpeed
=
65535
;
vibrator
.
wRightMotorSpeed
=
65535
;
result
=
pXInputSetState
(
controllerNum
,
&
vibrator
);
ok
(
result
==
ERROR_SUCCESS
||
result
==
ERROR_DEVICE_NOT_CONNECTED
,
"XInputSetState failed with (%d)
\n
"
,
result
);
pXInputEnable
(
1
);
}
result
=
pXInputSetState
(
XUSER_MAX_COUNT
+
1
,
&
vibrator
);
ok
(
result
==
ERROR_BAD_ARGUMENTS
,
"XInputSetState returned (%d)
\n
"
,
result
);
}
static
void
test_get_state
(
void
)
{
...
...
@@ -100,8 +131,11 @@ START_TEST(xinput)
return
;
}
pXInputEnable
=
(
void
*
)
GetProcAddress
(
hXinput
,
"XInputEnable"
);
pXInputSetState
=
(
void
*
)
GetProcAddress
(
hXinput
,
"XInputSetState"
);
pXInputGetState
=
(
void
*
)
GetProcAddress
(
hXinput
,
"XInputGetState"
);
pXInputGetCapabilities
=
(
void
*
)
GetProcAddress
(
hXinput
,
"XInputGetCapabilities"
);
test_set_state
();
test_get_state
();
test_get_capabilities
();
FreeLibrary
(
hXinput
);
...
...
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