Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
1b3feb2a
Commit
1b3feb2a
authored
Jan 06, 2009
by
Andrew Fenn
Committed by
Alexandre Julliard
Jan 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xinput1_3: Added tests for XInputGetKeystroke.
parent
ac3e24c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
xinput.c
dlls/xinput1_3/tests/xinput.c
+27
-0
No files found.
dlls/xinput1_3/tests/xinput.c
View file @
1b3feb2a
...
...
@@ -27,6 +27,7 @@ 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
DWORD
(
WINAPI
*
pXInputGetKeystroke
)(
DWORD
,
DWORD
,
PXINPUT_KEYSTROKE
);
static
void
test_set_state
(
void
)
{
...
...
@@ -96,6 +97,30 @@ static void test_get_state(void)
ok
(
result
==
ERROR_BAD_ARGUMENTS
,
"XInputGetState returned (%d)
\n
"
,
result
);
}
static
void
test_get_keystroke
(
void
)
{
XINPUT_KEYSTROKE
keystroke
;
DWORD
controllerNum
;
DWORD
result
;
for
(
controllerNum
=
0
;
controllerNum
<
XUSER_MAX_COUNT
;
controllerNum
++
)
{
ZeroMemory
(
&
keystroke
,
sizeof
(
XINPUT_KEYSTROKE
));
result
=
pXInputGetKeystroke
(
controllerNum
,
XINPUT_FLAG_GAMEPAD
,
&
keystroke
);
ok
(
result
==
ERROR_SUCCESS
||
result
==
ERROR_DEVICE_NOT_CONNECTED
,
"XInputGetKeystroke failed with (%d)
\n
"
,
result
);
if
(
ERROR_DEVICE_NOT_CONNECTED
==
result
)
{
skip
(
"Controller %d is not connected
\n
"
,
controllerNum
);
}
}
ZeroMemory
(
&
keystroke
,
sizeof
(
XINPUT_KEYSTROKE
));
result
=
pXInputGetKeystroke
(
XUSER_MAX_COUNT
+
1
,
XINPUT_FLAG_GAMEPAD
,
&
keystroke
);
ok
(
result
==
ERROR_BAD_ARGUMENTS
,
"XInputGetKeystroke returned (%d)
\n
"
,
result
);
}
static
void
test_get_capabilities
(
void
)
{
XINPUT_CAPABILITIES
capabilities
;
...
...
@@ -134,9 +159,11 @@ START_TEST(xinput)
pXInputEnable
=
(
void
*
)
GetProcAddress
(
hXinput
,
"XInputEnable"
);
pXInputSetState
=
(
void
*
)
GetProcAddress
(
hXinput
,
"XInputSetState"
);
pXInputGetState
=
(
void
*
)
GetProcAddress
(
hXinput
,
"XInputGetState"
);
pXInputGetKeystroke
=
(
void
*
)
GetProcAddress
(
hXinput
,
"XInputGetKeystroke"
);
pXInputGetCapabilities
=
(
void
*
)
GetProcAddress
(
hXinput
,
"XInputGetCapabilities"
);
test_set_state
();
test_get_state
();
test_get_keystroke
();
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