summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2004-04-24 21:13:16 +0000
committerKevin Ryde <user42@zip.com.au>2004-04-24 21:13:16 +0000
commit4064ed2ab5a470a98dc45d80780ff5a67293ee96 (patch)
treec115edc44f2f3e65a6bf555c982c9869dc1d18d2
parente8dde70d1f1353532f7c84dda740d7d50e82c3d2 (diff)
downloadguile-4064ed2ab5a470a98dc45d80780ff5a67293ee96.tar.gz
New file.
-rw-r--r--test-suite/tests/socket.test43
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))))))