1 From 4bd9feda896f146786de6481a63b449a1904047c Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
3 Date: Tue, 19 Jan 2010 18:49:06 +0100
4 Subject: Make `sockets.test' more robust.
6 * test-suite/tests/socket.test ("AF_INET6/SOCK_STREAM"): Gracefully
7 handle cases where this combination is not supported.
9 test-suite/tests/socket.test | 12 +++++++++---
10 1 file changed, 9 insertions(+), 3 deletions(-)
12 diff --git a/guile18/test-suite/tests/socket.test b/guile18/test-suite/tests/socket.test
13 index e73f585..0510f54 100644
14 --- a/guile18/test-suite/tests/socket.test
15 +++ b/guile18/test-suite/tests/socket.test
17 ;;;; socket.test --- test socket functions -*- scheme -*-
19 -;;;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
20 +;;;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
22 ;;;; This library is free software; you can redistribute it and/or
23 ;;;; modify it under the terms of the GNU Lesser General Public
26 ;; testing `bind', `listen' and `connect' on stream-oriented sockets
28 - (let ((server-socket (socket AF_INET6 SOCK_STREAM 0))
29 + (let ((server-socket
30 + ;; Some platforms don't support this protocol/family combination.
31 + (false-if-exception (socket AF_INET6 SOCK_STREAM 0)))
33 (server-listening? #f)
39 + (if (not server-socket)
40 + (throw 'unresolved))
43 (bind server-socket AF_INET6 ipv6-addr server-port)
45 (else (apply throw args)))))))
47 (pass-if "bind/sockaddr"
48 - (let* ((sock (socket AF_INET6 SOCK_STREAM 0))
49 + (let* ((sock (false-if-exception (socket AF_INET6 SOCK_STREAM 0)))
50 (sockaddr (make-socket-address AF_INET6 ipv6-addr client-port)))
52 + (throw 'unresolved))