xinput1_3: Test every xinput DLL version.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
2b5c93f779
commit
50cb6434bb
|
@ -47,14 +47,14 @@ 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);
|
||||||
|
|
||||||
pXInputEnable(0);
|
if (pXInputEnable) pXInputEnable(0);
|
||||||
|
|
||||||
vibrator.wLeftMotorSpeed = 65535;
|
vibrator.wLeftMotorSpeed = 65535;
|
||||||
vibrator.wRightMotorSpeed = 65535;
|
vibrator.wRightMotorSpeed = 65535;
|
||||||
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);
|
||||||
|
|
||||||
pXInputEnable(1);
|
if (pXInputEnable) pXInputEnable(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
result = pXInputSetState(XUSER_MAX_COUNT+1, &vibrator);
|
result = pXInputSetState(XUSER_MAX_COUNT+1, &vibrator);
|
||||||
|
@ -218,15 +218,31 @@ static void test_get_batteryinformation(void)
|
||||||
|
|
||||||
START_TEST(xinput)
|
START_TEST(xinput)
|
||||||
{
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
const char *name;
|
||||||
|
int version;
|
||||||
|
} libs[] = {
|
||||||
|
{ "xinput1_1.dll", 1 },
|
||||||
|
{ "xinput1_2.dll", 2 },
|
||||||
|
{ "xinput1_3.dll", 3 },
|
||||||
|
{ "xinput1_4.dll", 4 },
|
||||||
|
{ "xinput9_1_0.dll", 0 } /* legacy for XP/Vista */
|
||||||
|
};
|
||||||
HMODULE hXinput;
|
HMODULE hXinput;
|
||||||
void *pXInputGetStateEx_Ordinal;
|
void *pXInputGetStateEx_Ordinal;
|
||||||
hXinput = LoadLibraryA( "xinput1_3.dll" );
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < sizeof(libs) / sizeof(libs[0]); i++)
|
||||||
|
{
|
||||||
|
hXinput = LoadLibraryA( libs[i].name );
|
||||||
|
|
||||||
if (!hXinput)
|
if (!hXinput)
|
||||||
{
|
{
|
||||||
win_skip("Could not load xinput1_3.dll\n");
|
win_skip("Could not load %s\n", libs[i].name);
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
|
trace("Testing %s\n", libs[i].name);
|
||||||
|
|
||||||
pXInputEnable = (void*)GetProcAddress(hXinput, "XInputEnable");
|
pXInputEnable = (void*)GetProcAddress(hXinput, "XInputEnable");
|
||||||
pXInputSetState = (void*)GetProcAddress(hXinput, "XInputSetState");
|
pXInputSetState = (void*)GetProcAddress(hXinput, "XInputSetState");
|
||||||
|
@ -241,14 +257,31 @@ START_TEST(xinput)
|
||||||
/* XInputGetStateEx may not be present by name, use ordinal in this case */
|
/* XInputGetStateEx may not be present by name, use ordinal in this case */
|
||||||
if (!pXInputGetStateEx)
|
if (!pXInputGetStateEx)
|
||||||
pXInputGetStateEx = pXInputGetStateEx_Ordinal;
|
pXInputGetStateEx = pXInputGetStateEx_Ordinal;
|
||||||
ok (pXInputGetStateEx != NULL, "XInputGetStateEx not found in this dll version\n");
|
|
||||||
|
|
||||||
test_set_state();
|
test_set_state();
|
||||||
test_get_state();
|
test_get_state();
|
||||||
test_get_keystroke();
|
|
||||||
test_get_capabilities();
|
test_get_capabilities();
|
||||||
|
|
||||||
|
if (libs[i].version != 4)
|
||||||
test_get_dsoundaudiodevice();
|
test_get_dsoundaudiodevice();
|
||||||
|
else
|
||||||
|
ok(!pXInputGetDSoundAudioDeviceGuids, "XInputGetDSoundAudioDeviceGuids exists in %s\n", libs[i].name);
|
||||||
|
|
||||||
|
if (libs[i].version > 2)
|
||||||
|
{
|
||||||
|
test_get_keystroke();
|
||||||
test_get_batteryinformation();
|
test_get_batteryinformation();
|
||||||
|
ok(pXInputGetStateEx != NULL, "XInputGetStateEx not found in %s\n", libs[i].name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ok(!pXInputGetKeystroke, "XInputGetKeystroke exists in %s\n", libs[i].name);
|
||||||
|
ok(!pXInputGetStateEx, "XInputGetStateEx exists in %s\n", libs[i].name);
|
||||||
|
ok(!pXInputGetBatteryInformation, "XInputGetBatteryInformation exists in %s\n", libs[i].name);
|
||||||
|
if (libs[i].version == 0)
|
||||||
|
ok(!pXInputEnable, "XInputEnable exists in %s\n", libs[i].name);
|
||||||
|
}
|
||||||
|
|
||||||
FreeLibrary(hXinput);
|
FreeLibrary(hXinput);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue