Commit 547d9491 authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

xinput1_3/tests: Explain an important test and fix remaining style issues.

It's important to explain why the test is done like that so in the future nobody changes it without knowing the impacts. Signed-off-by: 's avatarBruno Jesus <00cpxxx@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 67eec14c
...@@ -50,7 +50,7 @@ static void test_set_state(void) ...@@ -50,7 +50,7 @@ static void test_set_state(void)
DWORD controllerNum; DWORD controllerNum;
DWORD result; DWORD result;
for(controllerNum=0; controllerNum < XUSER_MAX_COUNT; controllerNum++) for(controllerNum = 0; controllerNum < XUSER_MAX_COUNT; controllerNum++)
{ {
ZeroMemory(&vibrator, sizeof(XINPUT_VIBRATION)); ZeroMemory(&vibrator, sizeof(XINPUT_VIBRATION));
...@@ -59,6 +59,9 @@ static void test_set_state(void) ...@@ -59,6 +59,9 @@ static void test_set_state(void)
result = pXInputSetState(controllerNum, &vibrator); result = pXInputSetState(controllerNum, &vibrator);
ok(result == ERROR_SUCCESS || result == ERROR_DEVICE_NOT_CONNECTED, "XInputSetState failed with (%d)\n", result); ok(result == ERROR_SUCCESS || result == ERROR_DEVICE_NOT_CONNECTED, "XInputSetState failed with (%d)\n", result);
/* Disabling XInput here, queueing a vibration and then re-enabling XInput
* is used to prove that vibrations are auto enabled when resuming XInput.
* If XInputEnable is removed the vibration will never play. */
if (pXInputEnable) pXInputEnable(0); if (pXInputEnable) pXInputEnable(0);
vibrator.wLeftMotorSpeed = 65535; vibrator.wLeftMotorSpeed = 65535;
...@@ -133,7 +136,7 @@ static void test_get_keystroke(void) ...@@ -133,7 +136,7 @@ static void test_get_keystroke(void)
DWORD controllerNum; DWORD controllerNum;
DWORD result; DWORD result;
for(controllerNum=0; controllerNum < XUSER_MAX_COUNT; controllerNum++) for(controllerNum = 0; controllerNum < XUSER_MAX_COUNT; controllerNum++)
{ {
ZeroMemory(&keystroke, sizeof(XINPUT_KEYSTROKE)); ZeroMemory(&keystroke, sizeof(XINPUT_KEYSTROKE));
...@@ -158,7 +161,7 @@ static void test_get_capabilities(void) ...@@ -158,7 +161,7 @@ static void test_get_capabilities(void)
DWORD controllerNum; DWORD controllerNum;
DWORD result; DWORD result;
for(controllerNum=0; controllerNum < XUSER_MAX_COUNT; controllerNum++) for(controllerNum = 0; controllerNum < XUSER_MAX_COUNT; controllerNum++)
{ {
ZeroMemory(&capabilities, sizeof(XINPUT_CAPABILITIES)); ZeroMemory(&capabilities, sizeof(XINPUT_CAPABILITIES));
...@@ -188,7 +191,7 @@ static void test_get_dsoundaudiodevice(void) ...@@ -188,7 +191,7 @@ static void test_get_dsoundaudiodevice(void)
GUID testGuid = {0xFFFFFFFF, 0xFFFF, 0xFFFF, {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}}; GUID testGuid = {0xFFFFFFFF, 0xFFFF, 0xFFFF, {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}};
GUID emptyGuid = {0x0, 0x0, 0x0, {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}; GUID emptyGuid = {0x0, 0x0, 0x0, {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}};
for(controllerNum=0; controllerNum < XUSER_MAX_COUNT; controllerNum++) for(controllerNum = 0; controllerNum < XUSER_MAX_COUNT; controllerNum++)
{ {
soundRender = soundCapture = testGuid; soundRender = soundCapture = testGuid;
result = pXInputGetDSoundAudioDeviceGuids(controllerNum, &soundRender, &soundCapture); result = pXInputGetDSoundAudioDeviceGuids(controllerNum, &soundRender, &soundCapture);
...@@ -221,7 +224,7 @@ static void test_get_batteryinformation(void) ...@@ -221,7 +224,7 @@ static void test_get_batteryinformation(void)
DWORD result; DWORD result;
XINPUT_BATTERY_INFORMATION batteryInfo; XINPUT_BATTERY_INFORMATION batteryInfo;
for(controllerNum=0; controllerNum < XUSER_MAX_COUNT; controllerNum++) for(controllerNum = 0; controllerNum < XUSER_MAX_COUNT; controllerNum++)
{ {
ZeroMemory(&batteryInfo, sizeof(XINPUT_BATTERY_INFORMATION)); ZeroMemory(&batteryInfo, sizeof(XINPUT_BATTERY_INFORMATION));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment