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>
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);