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
37a7ca59
Commit
37a7ca59
authored
Jan 08, 2009
by
Andrew Fenn
Committed by
Alexandre Julliard
Jan 08, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xinput1_3: Added test for XInputGetBatteryInformation.
parent
907add75
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 @
37a7ca59
...
...
@@ -29,6 +29,7 @@ static DWORD (WINAPI *pXInputSetState)(DWORD, XINPUT_VIBRATION*);
static
void
(
WINAPI
*
pXInputEnable
)(
BOOL
);
static
DWORD
(
WINAPI
*
pXInputGetKeystroke
)(
DWORD
,
DWORD
,
PXINPUT_KEYSTROKE
);
static
DWORD
(
WINAPI
*
pXInputGetDSoundAudioDeviceGuids
)(
DWORD
,
GUID
*
,
GUID
*
);
static
DWORD
(
WINAPI
*
pXInputGetBatteryInformation
)(
DWORD
,
BYTE
,
XINPUT_BATTERY_INFORMATION
*
);
static
void
test_set_state
(
void
)
{
...
...
@@ -168,6 +169,30 @@ static void test_get_dsoundaudiodevice(void)
ok
(
result
==
ERROR_BAD_ARGUMENTS
,
"XInputGetDSoundAudioDeviceGuids returned (%d)
\n
"
,
result
);
}
static
void
test_get_batteryinformation
(
void
)
{
DWORD
controllerNum
;
DWORD
result
;
XINPUT_BATTERY_INFORMATION
batteryInfo
;
for
(
controllerNum
=
0
;
controllerNum
<
XUSER_MAX_COUNT
;
controllerNum
++
)
{
ZeroMemory
(
&
batteryInfo
,
sizeof
(
XINPUT_BATTERY_INFORMATION
));
result
=
pXInputGetBatteryInformation
(
controllerNum
,
BATTERY_DEVTYPE_GAMEPAD
,
&
batteryInfo
);
ok
(
result
==
ERROR_SUCCESS
||
result
==
ERROR_DEVICE_NOT_CONNECTED
,
"XInputGetBatteryInformation failed with (%d)
\n
"
,
result
);
if
(
ERROR_DEVICE_NOT_CONNECTED
==
result
)
{
ok
(
batteryInfo
.
BatteryLevel
==
BATTERY_TYPE_DISCONNECTED
,
"Failed to report device as being disconnected."
);
skip
(
"Controller %d is not connected
\n
"
,
controllerNum
);
}
}
result
=
pXInputGetBatteryInformation
(
XUSER_MAX_COUNT
+
1
,
BATTERY_DEVTYPE_GAMEPAD
,
&
batteryInfo
);
ok
(
result
==
ERROR_BAD_ARGUMENTS
,
"XInputGetBatteryInformation returned (%d)
\n
"
,
result
);
}
START_TEST
(
xinput
)
{
HMODULE
hXinput
;
...
...
@@ -185,12 +210,14 @@ START_TEST(xinput)
pXInputGetKeystroke
=
(
void
*
)
GetProcAddress
(
hXinput
,
"XInputGetKeystroke"
);
pXInputGetCapabilities
=
(
void
*
)
GetProcAddress
(
hXinput
,
"XInputGetCapabilities"
);
pXInputGetDSoundAudioDeviceGuids
=
(
void
*
)
GetProcAddress
(
hXinput
,
"XInputGetDSoundAudioDeviceGuids"
);
pXInputGetBatteryInformation
=
(
void
*
)
GetProcAddress
(
hXinput
,
"XInputGetBatteryInformation"
);
test_set_state
();
test_get_state
();
test_get_keystroke
();
test_get_capabilities
();
test_get_dsoundaudiodevice
();
test_get_batteryinformation
();
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