Reducing verbosity and fixing typos and potentially interleaved lines.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput8/tests/driver_hid.c | 16 +++++++++------- dlls/dinput8/tests/driver_hid.h | 11 +++++++++-- 2 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/dlls/dinput8/tests/driver_hid.c b/dlls/dinput8/tests/driver_hid.c index 45c9f3e14ab..d6f085e4f30 100644 --- a/dlls/dinput8/tests/driver_hid.c +++ b/dlls/dinput8/tests/driver_hid.c @@ -479,7 +479,7 @@ static NTSTATUS WINAPI driver_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
expect_queue_next( &expect_queue, code, packet, &index, &expect, TRUE ); winetest_push_context( "%s expect[%d]", expect.context, index ); - ok( expect.code == code, "got %#x, expected %#x\n", expect.code, code ); + ok( code == expect.code, "got %#x, expected %#x\n", code, expect.code ); ok( packet->reportId == expect.report_id, "got id %u\n", packet->reportId ); ok( packet->reportBufferLen == expect.report_len, "got len %u\n", packet->reportBufferLen ); ok( RtlCompareMemory( packet->reportBuffer, expect.report_buf, expect.report_len ) == expect.report_len, @@ -503,7 +503,7 @@ static NTSTATUS WINAPI driver_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
expect_queue_next( &expect_queue, code, packet, &index, &expect, FALSE ); winetest_push_context( "%s expect[%d]", expect.context, index ); - ok( expect.code == code, "got %#x, expected %#x\n", expect.code, code ); + ok( code == expect.code, "got %#x, expected %#x\n", code, expect.code ); ok( packet->reportId == expect.report_id, "got id %u\n", packet->reportId ); ok( packet->reportBufferLen == expect.report_len, "got len %u\n", packet->reportBufferLen ); winetest_pop_context(); @@ -526,7 +526,7 @@ static NTSTATUS WINAPI driver_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
expect_queue_next( &expect_queue, code, packet, &index, &expect, TRUE ); winetest_push_context( "%s expect[%d]", expect.context, index ); - ok( expect.code == code, "got %#x, expected %#x\n", expect.code, code ); + ok( code == expect.code, "got %#x, expected %#x\n", code, expect.code ); ok( packet->reportId == expect.report_id, "got id %u\n", packet->reportId ); ok( packet->reportBufferLen == expect.report_len, "got len %u\n", packet->reportBufferLen ); ok( RtlCompareMemory( packet->reportBuffer, expect.report_buf, expect.report_len ) == expect.report_len, @@ -550,7 +550,7 @@ static NTSTATUS WINAPI driver_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
expect_queue_next( &expect_queue, code, packet, &index, &expect, FALSE ); winetest_push_context( "%s expect[%d]", expect.context, index ); - ok( expect.code == code, "got %#x, expected %#x\n", expect.code, code ); + ok( code == expect.code, "got %#x, expected %#x\n", code, expect.code ); ok( packet->reportId == expect.report_id, "got id %u\n", packet->reportId ); ok( packet->reportBufferLen == expect.report_len, "got len %u\n", packet->reportBufferLen ); winetest_pop_context(); @@ -573,7 +573,7 @@ static NTSTATUS WINAPI driver_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
expect_queue_next( &expect_queue, code, packet, &index, &expect, TRUE ); winetest_push_context( "%s expect[%d]", expect.context, index ); - ok( expect.code == code, "got %#x, expected %#x\n", expect.code, code ); + ok( code == expect.code, "got %#x, expected %#x\n", code, expect.code ); ok( packet->reportId == expect.report_id, "got id %u\n", packet->reportId ); ok( packet->reportBufferLen == expect.report_len, "got len %u\n", packet->reportBufferLen ); ok( RtlCompareMemory( packet->reportBuffer, expect.report_buf, expect.report_len ) == expect.report_len, @@ -586,12 +586,14 @@ static NTSTATUS WINAPI driver_internal_ioctl( DEVICE_OBJECT *device, IRP *irp ) }
case IOCTL_HID_GET_STRING: - todo_wine - ok( 0, "unexpected IOCTL_HID_GET_STRING\n" ); + { + static unsigned int once; + if (!once++) todo_wine ok( 0, "unexpected IOCTL_HID_GET_STRING\n" ); memcpy( irp->UserBuffer, L"Wine Test", sizeof(L"Wine Test") ); irp->IoStatus.Information = sizeof(L"Wine Test"); ret = STATUS_SUCCESS; break; + }
default: ok( 0, "unexpected ioctl %#x\n", code ); diff --git a/dlls/dinput8/tests/driver_hid.h b/dlls/dinput8/tests/driver_hid.h index 4fec0e99e47..6c355760171 100644 --- a/dlls/dinput8/tests/driver_hid.h +++ b/dlls/dinput8/tests/driver_hid.h @@ -147,8 +147,15 @@ static inline void kvprintf( const char *format, va_list ap ) { struct tls_data *data = get_tls_data(); IO_STATUS_BLOCK io; - int len = vsnprintf( data->strings, sizeof(data->strings), format, ap ); - ZwWriteFile( okfile, NULL, NULL, NULL, &io, data->strings, len, NULL, NULL ); + int len = vsnprintf( data->str_pos, sizeof(data->strings) - (data->str_pos - data->strings), format, ap ); + data->str_pos += len; + + if (len && data->str_pos[-1] == '\n') + { + ZwWriteFile( okfile, NULL, NULL, NULL, &io, data->strings, + strlen( data->strings ), NULL, NULL ); + data->str_pos = data->strings; + } }
static inline void WINAPIV kprintf( const char *format, ... ) __WINE_PRINTF_ATTR( 1, 2 );