uffi/tests compress.lisp,1.5,1.6

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

Modified Files:
	compress.lisp 
Log Message:


Index: compress.lisp
===================================================================
RCS file: /pubcvs/uffi/tests/compress.lisp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** compress.lisp	29 Apr 2003 12:57:10 -0000	1.5
--- compress.lisp	29 Apr 2003 13:16:14 -0000	1.6
***************
*** 92,108 ****
  	    (uffi:free-foreign-object dest)))))))
  
! #+test-uffi
! (progn
!   (flet ((test-compress (str)
! 	   (multiple-value-bind (compressed len) (compress str)
! 	     (multiple-value-bind (uncompressed len2) (uncompress compressed)
! 	       (util.test:test str uncompressed :test #'string=
! 			       :fail-info "Error uncompressing a compressed string")))))
!     (test-compress "")
!     (test-compress "test")
!     (test-compress "test2")))
  
! ;; Results of the above on my system:
! ;; (compress "") => 789c300001,8
! ;; (compress "test") => 789c2b492d2e1045d1c1,12
! ;; (compress "test2") => 789c2b492d2e31206501f3,13
--- 92,109 ----
  	    (uffi:free-foreign-object dest)))))))
  
! (deftest compress.1 (map 'list #'char-code (compress ""))
!   (120 156 3 0 0 0 0 1))
! (deftest compress.2 (map 'list #'char-code  (compress "test"))
!   (120 156 43 73 45 46 1 0 4 93 1 193))
! (deftest compress.3 (map 'list #'char-code (compress "test2"))
!   (120 156 43 73 45 46 49 2 0 6 80 1 243))
  
! (defun compress-uncompress (str)
!   (multiple-value-bind (compressed len) (compress str)
!     (multiple-value-bind (uncompressed len2) (uncompress compressed)
!       uncompressed)))
! 
! 
! (deftest uncompress.1 "" "")
! (deftest uncompress.2 "test" "test")
! (deftest uncompress.3 "test2" "test2")