0.9.1.16:
[sbcl.git] / contrib / sb-bsd-sockets / tests.lisp
index 77b1e57..e2abc15 100644 (file)
       (network-unreachable-error () 'network-unreachable))
   t)
 
+(deftest socket-open-p-true.1
+    (socket-open-p (make-instance 'inet-socket :type :stream :protocol :tcp))
+  t)
+#+internet-available
+(deftest socket-open-p-true.2
+    (let ((s (make-instance 'inet-socket :type :stream :protocol :tcp)))
+      (unwind-protect 
+          (progn
+            (socket-connect s #(127 0 0 1) 7)
+            (socket-open-p s))
+       (socket-close s)))
+  t)
+(deftest socket-open-p-false
+    (let ((s (make-instance 'inet-socket :type :stream :protocol :tcp)))
+      (socket-close s)
+      (socket-open-p s))
+  nil)
 
 ;;; we don't have an automatic test for some of this yet.  There's no
 ;;; simple way to run servers and have something automatically connect