From 222d2d94e0946cd6fa6b2c20b896fb6236cf41d5 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Tue, 8 Jun 2021 12:28:53 +0200 Subject: [PATCH] user32/tests: Use winetest contexts to simplify set_clipboard_data_process(). Signed-off-by: Francois Gouget Signed-off-by: Alexandre Julliard --- dlls/user32/tests/clipboard.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/dlls/user32/tests/clipboard.c b/dlls/user32/tests/clipboard.c index 4b95675770b..5071008a0ab 100644 --- a/dlls/user32/tests/clipboard.c +++ b/dlls/user32/tests/clipboard.c @@ -151,24 +151,26 @@ static void set_clipboard_data_process( int arg ) { HANDLE ret; + winetest_push_context("process %u", arg); SetLastError( 0xdeadbeef ); if (arg) { - ok( IsClipboardFormatAvailable( CF_WAVE ), "process %u: CF_WAVE not available\n", arg ); + ok( IsClipboardFormatAvailable( CF_WAVE ), "CF_WAVE not available\n" ); ret = SetClipboardData( CF_WAVE, GlobalAlloc( GMEM_DDESHARE | GMEM_ZEROINIT, 100 )); - ok( ret != 0, "process %u: SetClipboardData failed err %u\n", arg, GetLastError() ); + ok( ret != 0, "SetClipboardData failed err %u\n", GetLastError() ); } else { SetClipboardData( CF_WAVE, 0 ); - ok( GetLastError() == ERROR_CLIPBOARD_NOT_OPEN, "process %u: wrong error %u\n", - arg, GetLastError()); - ok( !IsClipboardFormatAvailable( CF_WAVE ), "process %u: SetClipboardData succeeded\n", arg ); + ok( GetLastError() == ERROR_CLIPBOARD_NOT_OPEN, "wrong error %u\n", + GetLastError()); + ok( !IsClipboardFormatAvailable( CF_WAVE ), "SetClipboardData succeeded\n" ); ret = SetClipboardData( CF_WAVE, GlobalAlloc( GMEM_DDESHARE | GMEM_ZEROINIT, 100 )); - ok( !ret, "process %u: SetClipboardData succeeded\n", arg ); - ok( GetLastError() == ERROR_CLIPBOARD_NOT_OPEN, "process %u: wrong error %u\n", - arg, GetLastError()); + ok( !ret, "SetClipboardData succeeded\n" ); + ok( GetLastError() == ERROR_CLIPBOARD_NOT_OPEN, "wrong error %u\n", + GetLastError()); } + winetest_pop_context(); } static void grab_clipboard_process( int arg )