Ignore IPv6 tests, if IPv6 was built in but the system doesn't have it.
authorDiego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>
Wed, 24 Jun 2009 16:03:40 +0000 (18:03 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 29 Jun 2009 15:40:28 +0000 (17:40 +0200)
This removes a test failure when an IPv6-enabled PulseAudio is tested on a
system where IPv6 is not enabled in kernel.

src/tests/ipacl-test.c

index f89665c..57b7068 100644 (file)
@@ -91,8 +91,10 @@ int main(int argc, char *argv[]) {
     close(fd);
 
 #ifdef HAVE_IPV6
-    fd = socket(PF_INET6, SOCK_STREAM, 0);
-    assert(fd >= 0);
+    if ( (fd = socket(PF_INET6, SOCK_STREAM, 0)) < 0 ) {
+      printf("Unable to open IPv6 socket, IPv6 tests ignored");
+      return 0;
+    }
 
     memset(&sa6, 0, sizeof(sa6));
     sa6.sin6_family = AF_INET6;