]> code.delx.au - pulseaudio/blobdiff - src/tests/ipacl-test.c
tests: More useful output of make check
[pulseaudio] / src / tests / ipacl-test.c
index 74bafd75470b938317eed523cd39ed17d637045a..fa190cf0ddf72956a2e62aba801573c654ed672b 100644 (file)
@@ -17,8 +17,9 @@
 #include <netinet/ip.h>
 #endif
 
-#include <pulsecore/socket.h>
+#include <pulsecore/log.h>
 #include <pulsecore/macro.h>
+#include <pulsecore/socket.h>
 #include <pulsecore/ipacl.h>
 #include <pulsecore/arpa-inet.h>
 
@@ -30,7 +31,7 @@ static void do_ip_acl_check(const char *s, int fd, int expected) {
     result = pa_ip_acl_check(acl, fd);
     pa_ip_acl_free(acl);
 
-    printf("%-20s result=%u (should be %u)\n", s, result, expected);
+    pa_log_info("%-20s result=%u (should be %u)", s, result, expected);
     pa_assert(result == expected);
 }
 
@@ -42,6 +43,9 @@ int main(int argc, char *argv[]) {
     int fd;
     int r;
 
+    if (!getenv("MAKE_CHECK"))
+        pa_log_set_level(PA_LOG_DEBUG);
+
     fd = socket(PF_INET, SOCK_STREAM, 0);
     pa_assert(fd >= 0);
 
@@ -65,7 +69,7 @@ int main(int argc, char *argv[]) {
 
 #ifdef HAVE_IPV6
     if ( (fd = socket(PF_INET6, SOCK_STREAM, 0)) < 0 ) {
-      printf("Unable to open IPv6 socket, IPv6 tests ignored");
+      pa_log_error("Unable to open IPv6 socket, IPv6 tests ignored");
       return 0;
     }