uffi/tests atoifl.lisp,1.1,1.2 compress.lisp,1.4,1.5 package.lisp,1.1,1.2 strtol.lisp,1.1,1.2

"Kevin M. Rosenberg" <[email protected]> Tue, 29 Apr 2003 06:57:12 -0600
Newsgroups gmane.lisp.uffi.cvs
Message-ID <[email protected]>
Update of /pubcvs/uffi/tests
In directory boa.b9.com:/tmp/cvs-serv14841/tests

Modified Files:
	atoifl.lisp compress.lisp package.lisp strtol.lisp 
Log Message:


Index: atoifl.lisp
===================================================================
RCS file: /pubcvs/uffi/tests/atoifl.lisp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** atoifl.lisp	30 Sep 2002 10:02:36 -0000	1.1
--- atoifl.lisp	29 Apr 2003 12:57:10 -0000	1.2
***************
*** 17,21 ****
  ;;;; *************************************************************************
  
! (in-package :cl-user)
  
  (uffi:def-function ("atoi" c-atoi) 
--- 17,21 ----
  ;;;; *************************************************************************
  
! (in-package :uffi-tests)
  
  (uffi:def-function ("atoi" c-atoi) 
***************
*** 41,59 ****
      (c-atof str-cstring)))
    
! #+examples-uffi
! (progn
!   (flet ((print-results (str)
! 	   (format t "~&(atoi ~S) => ~S" str (atoi str))))
!     (print-results "55")))
! 
! 
! #+test-uffi
! (progn
!   (util.test:test (atoi "123") 123 :test #'eql
! 		  :fail-info "Error with atoi")
!   (util.test:test (atoi "") 0 :test #'eql
! 		  :fail-info "Error with atoi")
!   (util.test:test (atof "2.23") 2.23d0 :test #'eql
! 		  :fail-info "Error with atof")
!   )
!   
--- 41,45 ----
      (c-atof str-cstring)))
    
! (deftest atoi.1 (atoi "123") 123)
! (deftest atoi.2 (atoi "") 0)
! (deftest atof.3 (atof "2.23") 2.23d0)

Index: compress.lisp
===================================================================
RCS file: /pubcvs/uffi/tests/compress.lisp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** compress.lisp	10 Mar 2003 17:37:05 -0000	1.4
--- compress.lisp	29 Apr 2003 12:57:10 -0000	1.5
***************
*** 17,21 ****
  ;;;; *************************************************************************
  
! (in-package :cl-user)
  
  (eval-when (:load-toplevel :execute)
--- 17,21 ----
  ;;;; *************************************************************************
  
! (in-package :uffi-tests)
  
  (eval-when (:load-toplevel :execute)
***************
*** 91,105 ****
  	    (uffi:free-foreign-object destlen)
  	    (uffi:free-foreign-object dest)))))))
- 
- #+examples-uffi
- (progn
-   (flet ((print-results (str)
- 	   (multiple-value-bind (compressed len) (compress str)
- 	     (let ((*print-length* nil))
- 	       (format t "~&(compress ~S) => " str)
- 	       (format t "~S~%" (map 'list #'char-code compressed))))))
-     (print-results "")
-     (print-results "test")
-     (print-results "test2")))
  
  #+test-uffi
--- 91,94 ----

Index: package.lisp
===================================================================
RCS file: /pubcvs/uffi/tests/package.lisp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** package.lisp	29 Apr 2003 12:42:03 -0000	1.1
--- package.lisp	29 Apr 2003 12:57:10 -0000	1.2
***************
*** 12,16 ****
  
  (defpackage #:uffi-tests
!   (:use #:asdf #:cl #:uffi #:rtest))
  
  (in-package #:uffi-tests)
--- 12,17 ----
  
  (defpackage #:uffi-tests
!   (:use #:asdf #:cl #:uffi #:rtest)
!   (:shadowing-import-from #:uffi #:run-shell-command))
  
  (in-package #:uffi-tests)

Index: strtol.lisp
===================================================================
RCS file: /pubcvs/uffi/tests/strtol.lisp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** strtol.lisp	30 Sep 2002 10:02:36 -0000	1.1
--- strtol.lisp	29 Apr 2003 12:57:10 -0000	1.2
***************
*** 17,21 ****
  ;;;; *************************************************************************
  
! (in-package :cl-user)
  
  (uffi:def-foreign-type char-ptr (* :unsigned-char))
--- 17,21 ----
  ;;;; *************************************************************************
  
! (in-package :uffi-tests)
  
  (uffi:def-foreign-type char-ptr (* :unsigned-char))
***************
*** 58,82 ****
  	(uffi:free-foreign-object endptr)))))
  
!  
!   
! #+examples-uffi
! (progn
!   (flet ((print-results (str)
! 	   (multiple-value-bind (result flag) (strtol str)
! 	     (format t "~&(strtol ~S) => ~S,~S" str result flag))))
!     (print-results "55")
!     (print-results "55.3")
!     (print-results "a")))
  
- #+test-uffi
- (progn
-   (flet ((test-strtol (str results)
- 	   (util.test:test (multiple-value-list (strtol str)) results
- 			   :test #'equal
- 			   :fail-info "Error testing strtol")))
-     (test-strtol "123" '(123 t))
-     (test-strtol "0" '(0 t))
-     (test-strtol "55a" '(55 2))
-     (test-strtol "a" '(nil nil))))
  
  			   
--- 58,66 ----
  	(uffi:free-foreign-object endptr)))))
  
! (deftest strtol.1 (strtol "123") 123 t)
! (deftest strtol.2 (strtol "0") 0 t)
! (deftest strtol.3 (strtol "55a") 55 2)
! (deftest strtol.4 (strtol "a") nil nil)