diff options
-rw-r--r-- | test-suite/tests/socket.test | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test-suite/tests/socket.test b/test-suite/tests/socket.test new file mode 100644 index 000000000..6ebf5a58f --- /dev/null +++ b/test-suite/tests/socket.test @@ -0,0 +1,43 @@ +;;;; socket.test --- test socket functions -*- scheme -*- +;;;; +;;;; Copyright (C) 2004 Free Software Foundation, Inc. +;;;; +;;;; This library is free software; you can redistribute it and/or +;;;; modify it under the terms of the GNU Lesser General Public +;;;; License as published by the Free Software Foundation; either +;;;; version 2.1 of the License, or (at your option) any later version. +;;;; +;;;; This library is distributed in the hope that it will be useful, +;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;;; Lesser General Public License for more details. +;;;; +;;;; You should have received a copy of the GNU Lesser General Public +;;;; License along with this library; if not, write to the Free Software +;;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +(define-module (test-suite test-numbers) + #:use-module (test-suite lib)) + +;;; +;;; inet-ntop +;;; + +(if (defined? 'inet-ntop) + (with-test-prefix "inet-ntop" + + (with-test-prefix "ipv6" + (pass-if "0" + (string? (inet-ntop AF_INET6 0))) + + (pass-if "2^128-1" + (string? (inet-ntop AF_INET6 (1- (ash 1 128))))) + + (pass-if-exception "-1" exception:out-of-range + (inet-ntop AF_INET6 -1)) + + (pass-if-exception "2^128" exception:out-of-range + (inet-ntop AF_INET6 (ash 1 128))) + + (pass-if-exception "2^1024" exception:out-of-range + (inet-ntop AF_INET6 (ash 1 1024)))))) |