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
6b88529b
Commit
6b88529b
authored
Dec 13, 2016
by
Bruno Jesus
Committed by
Alexandre Julliard
Dec 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xinput1_3/tests: Add interactive tests.
Signed-off-by:
Bruno Jesus
<
00cpxxx@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
101edb1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
2 deletions
+26
-2
xinput.c
dlls/xinput1_3/tests/xinput.c
+26
-2
No files found.
dlls/xinput1_3/tests/xinput.c
View file @
6b88529b
...
...
@@ -96,8 +96,7 @@ static void test_get_state(void)
XINPUT_STATE
state
;
XINPUT_STATE_EX
state_ex
;
}
xinput
;
DWORD
controllerNum
,
i
;
DWORD
result
;
DWORD
controllerNum
,
i
,
result
,
good
=
XUSER_MAX_COUNT
;
for
(
i
=
0
;
i
<
(
pXInputGetStateEx
?
2
:
1
);
i
++
)
{
...
...
@@ -120,7 +119,10 @@ static void test_get_state(void)
trace
(
"-- Results for controller %d --
\n
"
,
controllerNum
);
if
(
i
==
0
)
{
good
=
controllerNum
;
trace
(
"XInputGetState: %d
\n
"
,
result
);
}
else
trace
(
"XInputGetStateEx: %d
\n
"
,
result
);
trace
(
"State->dwPacketNumber: %d
\n
"
,
xinput
.
state
.
dwPacketNumber
);
...
...
@@ -141,6 +143,28 @@ static void test_get_state(void)
result
=
pXInputGetStateEx
(
XUSER_MAX_COUNT
+
1
,
&
xinput
.
state_ex
);
ok
(
result
==
ERROR_BAD_ARGUMENTS
,
"XInputGetState returned (%d)
\n
"
,
result
);
}
if
(
winetest_interactive
&&
good
<
XUSER_MAX_COUNT
)
{
DWORD
now
=
GetTickCount
(),
packet
=
0
;
XINPUT_GAMEPAD
*
game
=
&
xinput
.
state
.
Gamepad
;
trace
(
"You have 20 seconds to test the joystick freely
\n
"
);
do
{
Sleep
(
100
);
pXInputGetState
(
good
,
&
xinput
.
state
);
if
(
xinput
.
state
.
dwPacketNumber
==
packet
)
continue
;
packet
=
xinput
.
state
.
dwPacketNumber
;
trace
(
"Buttons 0x%04X Triggers %3d/%3d LT %6d/%6d RT %6d/%6d
\n
"
,
game
->
wButtons
,
game
->
bLeftTrigger
,
game
->
bRightTrigger
,
game
->
sThumbLX
,
game
->
sThumbLY
,
game
->
sThumbRX
,
game
->
sThumbRY
);
}
while
(
GetTickCount
()
-
now
<
20000
);
trace
(
"Test over...
\n
"
);
}
}
static
void
test_get_keystroke
(
void
)
...
...
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