[1/2] shell32/tests: Trace the last ShellExecute command whenever a corresponding test fails.

Alexandre Julliard julliard at winehq.org
Fri Jan 22 03:04:00 CST 2016


Francois Gouget <fgouget at codeweavers.com> writes:

> Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
> ---
>  dlls/shell32/tests/shlexec.c | 75 ++++++++++++++++++++++++++++++--------------
>  1 file changed, 52 insertions(+), 23 deletions(-)
>
> diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c
> index 8f03799..360fb2b 100644
> --- a/dlls/shell32/tests/shlexec.c
> +++ b/dlls/shell32/tests/shlexec.c
> @@ -94,6 +94,28 @@ static int _todo_wait = 0;
>  #define todo_wait for (_todo_wait = 1; _todo_wait; _todo_wait = 0)
>  
>  static char shell_call[2048]="";
> +static char last_shell_call[2048]="";
> +static void WINETEST_PRINTF_ATTR(2,3) _okShell(int condition, const char *msg, ...)
> +{
> +    va_list valist;
> +
> +    /* Note: if winetest_debug > 1 the ShellExecute() command has already been
> +     * traced.
> +     */
> +    if (winetest_debug <= 1 && !condition && strcmp(last_shell_call, shell_call))
> +    {
> +        winetest_trace("Called %s\n", shell_call);
> +        strcpy(last_shell_call, shell_call);
> +    }
> +
> +    va_start(valist, msg);
> +    winetest_vok(condition, msg, valist);
> +    va_end(valist);
> +}

Why is that better than always printing it in the failing calls?

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list