[PATCH 1/2] Fix test/signal-logging to work on Solaris

Peter Hutterer peter.hutterer at who-t.net
Mon Feb 10 22:06:43 PST 2014


On Sun, Feb 09, 2014 at 11:13:50PM -0800, Alan Coopersmith wrote:
> For some reason, Solaris libc sprintf() doesn't add "0x" to the %p output
> as glibc does, causing the test to fail for not matching the exact output.
> Since the 0x is desirable, we add it ourselves to the test string.
> 
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
for both

Cheers,
   Peter

> ---
>  test/signal-logging.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/test/signal-logging.c b/test/signal-logging.c
> index d894373..88b37c1 100644
> --- a/test/signal-logging.c
> +++ b/test/signal-logging.c
> @@ -346,7 +346,11 @@ static void logging_format(void)
>      ptr = 1;
>      do {
>          char expected[30];
> +#ifdef __sun /* Solaris doesn't autoadd "0x" to %p format */
> +        sprintf(expected, "(EE) 0x%p\n", (void*)ptr);
> +#else
>          sprintf(expected, "(EE) %p\n", (void*)ptr);
> +#endif
>          LogMessageVerbSigSafe(X_ERROR, -1, "%p\n", (void*)ptr);
>          read_log_msg(logmsg);
>          assert(strcmp(logmsg, expected) == 0);
> -- 
> 1.7.9.2
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
> 


More information about the xorg-devel mailing list