dinput/tests: Remove output and feature report buffers length checks.

They are checked against the expected packet anyway, and they otherwise
are enforced to match their specific individual report length, which we
don't have any info about here.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2022-04-27 08:23:24 +02:00 committed by Alexandre Julliard
parent 92f05bd3e7
commit 3f290740c0
2 changed files with 22 additions and 17 deletions

View File

@ -1072,11 +1072,10 @@ static NTSTATUS WINAPI pdo_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
case IOCTL_HID_WRITE_REPORT:
{
HID_XFER_PACKET *packet = irp->UserBuffer;
ULONG expected_size = impl->caps.OutputReportByteLength - (impl->use_report_id ? 0 : 1);
ok( in_size == sizeof(*packet), "got input size %lu\n", in_size );
ok( !out_size, "got output size %lu\n", out_size );
ok( packet->reportBufferLen >= expected_size, "got report size %lu\n", packet->reportBufferLen );
ok( !!packet->reportBuffer, "got buffer %p\n", packet->reportBuffer );
expect_queue_next( &impl->expect_queue, code, packet, &index, &expect, TRUE, context, sizeof(context) );
winetest_push_context( "%s expect[%ld]", context, index );
@ -1095,11 +1094,9 @@ static NTSTATUS WINAPI pdo_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
case IOCTL_HID_GET_INPUT_REPORT:
{
HID_XFER_PACKET *packet = irp->UserBuffer;
ULONG expected_size = impl->caps.InputReportByteLength - (impl->use_report_id ? 0 : 1);
ok( !in_size, "got input size %lu\n", in_size );
ok( out_size == sizeof(*packet), "got output size %lu\n", out_size );
ok( packet->reportBufferLen >= expected_size, "got len %lu\n", packet->reportBufferLen );
ok( !!packet->reportBuffer, "got buffer %p\n", packet->reportBuffer );
expect_queue_next( &impl->expect_queue, code, packet, &index, &expect, FALSE, context, sizeof(context) );
@ -1119,11 +1116,9 @@ static NTSTATUS WINAPI pdo_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
case IOCTL_HID_SET_OUTPUT_REPORT:
{
HID_XFER_PACKET *packet = irp->UserBuffer;
ULONG expected_size = impl->caps.OutputReportByteLength - (impl->use_report_id ? 0 : 1);
ok( in_size == sizeof(*packet), "got input size %lu\n", in_size );
ok( !out_size, "got output size %lu\n", out_size );
ok( packet->reportBufferLen >= expected_size, "got len %lu\n", packet->reportBufferLen );
ok( !!packet->reportBuffer, "got buffer %p\n", packet->reportBuffer );
expect_queue_next( &impl->expect_queue, code, packet, &index, &expect, TRUE, context, sizeof(context) );
@ -1143,11 +1138,9 @@ static NTSTATUS WINAPI pdo_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
case IOCTL_HID_GET_FEATURE:
{
HID_XFER_PACKET *packet = irp->UserBuffer;
ULONG expected_size = impl->caps.FeatureReportByteLength - (impl->use_report_id ? 0 : 1);
ok( !in_size, "got input size %lu\n", in_size );
ok( out_size == sizeof(*packet), "got output size %lu\n", out_size );
ok( packet->reportBufferLen >= expected_size, "got len %lu\n", packet->reportBufferLen );
ok( !!packet->reportBuffer, "got buffer %p\n", packet->reportBuffer );
expect_queue_next( &impl->expect_queue, code, packet, &index, &expect, FALSE, context, sizeof(context) );
@ -1167,11 +1160,9 @@ static NTSTATUS WINAPI pdo_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
case IOCTL_HID_SET_FEATURE:
{
HID_XFER_PACKET *packet = irp->UserBuffer;
ULONG expected_size = impl->caps.FeatureReportByteLength - (impl->use_report_id ? 0 : 1);
ok( in_size == sizeof(*packet), "got input size %lu\n", in_size );
ok( !out_size, "got output size %lu\n", out_size );
ok( packet->reportBufferLen >= expected_size, "got len %lu\n", packet->reportBufferLen );
ok( !!packet->reportBuffer, "got buffer %p\n", packet->reportBuffer );
expect_queue_next( &impl->expect_queue, code, packet, &index, &expect, TRUE, context, sizeof(context) );

View File

@ -2012,7 +2012,11 @@ static BOOL test_force_feedback_joystick( DWORD version )
struct hid_device_desc desc =
{
.use_report_id = TRUE,
.caps = { .InputReportByteLength = 5 },
.caps =
{
.InputReportByteLength = 5,
.OutputReportByteLength = 11,
},
.attributes = default_attributes,
};
const DIDEVCAPS expect_caps =
@ -3467,7 +3471,12 @@ static void test_device_managed_effect(void)
struct hid_device_desc desc =
{
.use_report_id = TRUE,
.caps = { .InputReportByteLength = 5 },
.caps =
{
.InputReportByteLength = 5,
.OutputReportByteLength = 11,
.FeatureReportByteLength = 5,
},
.attributes = default_attributes,
};
struct hid_expect expect_acquire[] =
@ -5004,7 +5013,12 @@ static void test_windows_gaming_input(void)
struct hid_device_desc desc =
{
.use_report_id = TRUE,
.caps = { .InputReportByteLength = 6 },
.caps =
{
.InputReportByteLength = 6,
.OutputReportByteLength = 11,
.FeatureReportByteLength = 5,
},
.attributes = default_attributes,
};
struct hid_expect expect_init[] =