summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2014-02-09 23:13:50 -0800
committerKeith Packard <keithp@keithp.com>2014-02-24 16:31:45 -0800
commit0031f6b073c7a4cca553c1d3e185a63436a75cbe (patch)
treeb30c784bd005b9215d4ea6aa581a5cab583efc3a /test
parente67f2d7e0f9189beb2907fa06cff5ecc7f35f922 (diff)
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 <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'test')
-rw-r--r--test/signal-logging.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/signal-logging.c b/test/signal-logging.c
index d894373f0..88b37c14e 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);