From: Alan Coopersmith Date: Mon, 10 Feb 2014 07:13:50 +0000 (-0800) Subject: Fix test/signal-logging to work on Solaris X-Git-Tag: upstream/1.15.99.902~96 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0031f6b073c7a4cca553c1d3e185a63436a75cbe;p=platform%2Fupstream%2Fxorg-server.git Fix test/signal-logging to work on Solaris 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 Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard --- 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);