Commit dab7d15c authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dinput8/tests: Improve HID joystick tests output.

Reducing verbosity and fixing typos and potentially interleaved lines. Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 0056ebf9
......@@ -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 );
......
......@@ -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 );
......
......@@ -594,22 +594,19 @@ static BOOL pnp_driver_start( const WCHAR *resource )
return ret || GetLastError() == ERROR_SERVICE_ALREADY_RUNNING;
}
#define check_member_( file, line, val, exp, fmt, member ) \
ok_( file, line )((val).member == (exp).member, "got " #member " " fmt ", expected " fmt "\n", \
(val).member, (exp).member)
#define check_member( val, exp, fmt, member ) \
#define check_member_( file, line, val, exp, fmt, member ) \
ok_(file, line)( (val).member == (exp).member, "got " #member " " fmt "\n", (val).member )
#define check_member( val, exp, fmt, member ) \
check_member_( __FILE__, __LINE__, val, exp, fmt, member )
#define check_member_guid_( file, line, val, exp, member ) \
ok_( file, line )(IsEqualGUID( &(val).member, &(exp).member ), "got " #member " %s, expected %s\n", \
debugstr_guid( &(val).member ), debugstr_guid( &(exp).member ))
#define check_member_guid( val, exp, member ) \
#define check_member_guid_( file, line, val, exp, member ) \
ok_(file, line)( IsEqualGUID( &(val).member, &(exp).member ), "got " #member " %s\n", debugstr_guid(&(val).member) )
#define check_member_guid( val, exp, member ) \
check_member_guid_( __FILE__, __LINE__, val, exp, member )
#define check_member_wstr_( file, line, val, exp, member ) \
ok_( file, line )(!wcscmp( (val).member, (exp).member ), "got " #member " %s, expected %s\n", \
debugstr_w((val).member), debugstr_w((exp).member))
#define check_member_wstr( val, exp, member ) \
#define check_member_wstr_( file, line, val, exp, member ) \
ok_(file, line)( !wcscmp( (val).member, (exp).member ), "got " #member " %s\n", debugstr_w((val).member) )
#define check_member_wstr( val, exp, member ) \
check_member_wstr_( __FILE__, __LINE__, val, exp, member )
#define check_hidp_caps( a, b ) check_hidp_caps_( __LINE__, a, b )
......
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