Commit a21d4fb8 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

user32/tests: Use the caller line number for open_clipboard() & co.

In particular this stops the traces in open_clipboard() and has_no_open_wnd() from clobbering the line number when used in expressions such as ok(has_no_open_wnd(), ...). Signed-off-by: 's avatarFrancois Gouget <fgouget@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 91a791e5
...@@ -33,7 +33,8 @@ static BOOL (WINAPI *pGetUpdatedClipboardFormats)( UINT *formats, UINT count, UI ...@@ -33,7 +33,8 @@ static BOOL (WINAPI *pGetUpdatedClipboardFormats)( UINT *formats, UINT count, UI
static int thread_from_line; static int thread_from_line;
static char *argv0; static char *argv0;
static BOOL open_clipboard(HWND hwnd) #define open_clipboard(hwnd) open_clipboard_(__LINE__, hwnd)
static BOOL open_clipboard_(int line, HWND hwnd)
{ {
DWORD start = GetTickCount(); DWORD start = GetTickCount();
while (1) while (1)
...@@ -54,7 +55,7 @@ static BOOL open_clipboard(HWND hwnd) ...@@ -54,7 +55,7 @@ static BOOL open_clipboard(HWND hwnd)
* response to a native application. * response to a native application.
*/ */
GetClassNameA(clipwnd, classname, ARRAY_SIZE(classname)); GetClassNameA(clipwnd, classname, ARRAY_SIZE(classname));
trace("%p (%s) opened the clipboard\n", clipwnd, classname); trace_(__FILE__, line)("%p (%s) opened the clipboard\n", clipwnd, classname);
SetLastError(le); SetLastError(le);
return ret; return ret;
} }
...@@ -62,7 +63,8 @@ static BOOL open_clipboard(HWND hwnd) ...@@ -62,7 +63,8 @@ static BOOL open_clipboard(HWND hwnd)
} }
} }
static BOOL has_no_open_wnd(void) #define has_no_open_wnd() has_no_open_wnd_(__LINE__)
static BOOL has_no_open_wnd_(int line)
{ {
DWORD start = GetTickCount(); DWORD start = GetTickCount();
DWORD le = GetLastError(); DWORD le = GetLastError();
...@@ -76,7 +78,7 @@ static BOOL has_no_open_wnd(void) ...@@ -76,7 +78,7 @@ static BOOL has_no_open_wnd(void)
le = GetLastError(); le = GetLastError();
/* See open_clipboard() */ /* See open_clipboard() */
GetClassNameA(clipwnd, classname, ARRAY_SIZE(classname)); GetClassNameA(clipwnd, classname, ARRAY_SIZE(classname));
trace("%p (%s) opened the clipboard\n", clipwnd, classname); trace_(__FILE__, line)("%p (%s) opened the clipboard\n", clipwnd, classname);
SetLastError(le); SetLastError(le);
return FALSE; return FALSE;
} }
......
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