[PATCH] user32/tests: Use winetest contexts to simplify set_clipboard_data_process().

Francois Gouget fgouget at codeweavers.com
Tue Jun 8 05:28:53 CDT 2021


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 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 )
-- 
2.20.1




More information about the wine-devel mailing list