Reducing verbosity and fixing typos and potentially interleaved lines.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
v2: Only send the first patches, reduce tests verbosity even more.
dlls/dinput8/tests/driver_hid.c | 16 +++++++++-------
dlls/dinput8/tests/driver_hid.h | 11 +++++++++--
dlls/dinput8/tests/hid.c | 21 +++++++++------------
3 files changed, 27 insertions(+), 21 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 );
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index 66e8c7c0b0d..a4721b246eb 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -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 )
--
2.33.1