[Ecls-list] Fwd: [ANNOUNCE] usocket 0.2.2
Juan Jose Garcia-Ripoll
jjgarcia at users.sourceforge.net
Sun Jan 14 12:45:26 UTC 2007
2007/1/11, Erik Huelsmann <ehuels at gmail.com>:
> After having set all the variables correctly, I get the following
> output (stripped for clarity):
>
> Test USOCKET-TEST::SOCKET-CONNECT.1 failed
> Expected value: T
> Actual value: (#<The STANDARD-CLASS USOCKET>
> #<The STANDARD-CLASS STANDARD-OBJECT> #<The BUILT-IN-CLASS T>).
There is nothing wrong with ECL. Your test is simply assuming
something which is not true, which is that the output of TYPEP is
either T or NIL. When checking whether an object is of a given class,
ECL outputs the list of parent classes. That is fully ANSI conformant:
http://www.lisp.org/HyperSpec/Body/fun_typep.html
You should correct your tests as follows. Instead of
(deftest socket-connect.3
(with-caught-conditions (nil nil)
(let ((sock (usocket:socket-connect (usocket::host-byte-order
+common-lisp-net+) 80)))
(unwind-protect
(typep sock 'usocket:usocket)
(usocket:socket-close sock))))
t)
Use
(with-caught-conditions (nil nil)
(let ((sock (usocket:socket-connect (usocket::host-byte-order
+common-lisp-net+) 80)))
(unwind-protect
(and (typep sock 'usocket:usocket) t)
(usocket:socket-close sock))))
t)
Using this I only get two failures which are due to a different
network configuration than yours
Doing 15 pending tests of 15 tests total.
USOCKET-TEST::MAKE-SOCKET.1 USOCKET-TEST::MAKE-SOCKET.2
USOCKET-TEST::SOCKET-NO-CONNECT.1 USOCKET-TEST::SOCKET-NO-CONNECT.2
USOCKET-TEST::SOCKET-NO-CONNECT.3 USOCKET-TEST::SOCKET-FAILURE.1
Test USOCKET-TEST::SOCKET-FAILURE.2 failed
Form: (USOCKET-TEST::WITH-CAUGHT-CONDITIONS
('USOCKET:HOST-UNREACHABLE-ERROR NIL)
(USOCKET:SOCKET-CONNECT USOCKET-TEST::+NON-EXISTING-HOST+ 80)
:UNREACH)
Expected value: NIL
Actual value: :UNREACH.
USOCKET-TEST::SOCKET-CONNECT.1 USOCKET-TEST::SOCKET-CONNECT.2
USOCKET-TEST::SOCKET-CONNECT.3 USOCKET-TEST::SOCKET-STREAM.1
USOCKET-TEST::SOCKET-NAME.1 USOCKET-TEST::SOCKET-NAME.2
USOCKET-TEST::SOCKET-NAME.3
Test USOCKET-TEST::SOCKET-NAME.4 failed
Form: (USOCKET-TEST::WITH-CAUGHT-CONDITIONS (NIL NIL)
(LET ((USOCKET-TEST::SOCK
(USOCKET:SOCKET-CONNECT
USOCKET-TEST::+COMMON-LISP-NET+
80)))
(UNWIND-PROTECT
(USOCKET:GET-LOCAL-ADDRESS
USOCKET-TEST::SOCK)
(USOCKET:SOCKET-CLOSE
USOCKET-TEST::SOCK))))
Expected value: #(192 168 1 65)
Actual value: #(192 168 1 35).
2 out of 15 total tests failed: USOCKET-TEST::SOCKET-FAILURE.2,
USOCKET-TEST::SOCKET-NAME.4.
NIL
--
Dpto. de Fisica Teorica I, Fac. de CC Fisicas, Universidad Complutense,
Ciudad Universitaria s/n Madrid 2804 (Spain)
http://teorica.fis.ucm.es/~jjgarcia/
More information about the ecl-devel
mailing list