r4702: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Tue, 29 Apr 2003 13:16:14 +0000 (13:16 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Tue, 29 Apr 2003 13:16:14 +0000 (13:16 +0000)
tests/compress.lisp
uffi-tests.asd

index 86d840d6e83b7f0e6f50cc22e07b7c686b54274c..fcff615d1bfc79802d7a19383b9190bd19e8871f 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg\r
 ;;;; Date Started:  Feb 2002\r
 ;;;;\r
-;;;; $Id: compress.lisp,v 1.5 2003/04/29 12:57:10 kevin Exp $\r
+;;;; $Id: compress.lisp,v 1.6 2003/04/29 13:16:14 kevin Exp $\r
 ;;;;\r
 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg\r
 ;;;;\r
            (uffi:free-foreign-object destlen)\r
            (uffi:free-foreign-object dest)))))))\r
 \r
-#+test-uffi\r
-(progn\r
-  (flet ((test-compress (str)\r
-          (multiple-value-bind (compressed len) (compress str)\r
-            (multiple-value-bind (uncompressed len2) (uncompress compressed)\r
-              (util.test:test str uncompressed :test #'string=\r
-                              :fail-info "Error uncompressing a compressed string")))))\r
-    (test-compress "")\r
-    (test-compress "test")\r
-    (test-compress "test2")))\r
+(deftest compress.1 (map 'list #'char-code (compress ""))\r
+  (120 156 3 0 0 0 0 1))\r
+(deftest compress.2 (map 'list #'char-code  (compress "test"))\r
+  (120 156 43 73 45 46 1 0 4 93 1 193))\r
+(deftest compress.3 (map 'list #'char-code (compress "test2"))\r
+  (120 156 43 73 45 46 49 2 0 6 80 1 243))\r
 \r
-;; Results of the above on my system:\r
-;; (compress "") => 789c300001,8\r
-;; (compress "test") => 789c2b492d2e1045d1c1,12\r
-;; (compress "test2") => 789c2b492d2e31206501f3,13\r
+(defun compress-uncompress (str)\r
+  (multiple-value-bind (compressed len) (compress str)\r
+    (multiple-value-bind (uncompressed len2) (uncompress compressed)\r
+      uncompressed)))\r
+\r
+\r
+(deftest uncompress.1 "" "")\r
+(deftest uncompress.2 "test" "test")\r
+(deftest uncompress.3 "test2" "test2")\r
index d3c9cccc1e9605658469de6bbe21eb85f6c2503b..0bf6ab3315f5aff849b7a08bd1874d80c4d05cc8 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Author:        Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2003
 ;;;;
-;;;; $Id: uffi-tests.asd,v 1.2 2003/04/29 12:57:10 kevin Exp $
+;;;; $Id: uffi-tests.asd,v 1.3 2003/04/29 13:16:14 kevin Exp $
 ;;;; *************************************************************************
 
 (defpackage #:uffi-tests-system
@@ -23,6 +23,7 @@
               (:file "package" :depends-on ("rt"))
               (:file "strtol" :depends-on ("package"))
               (:file "atoifl" :depends-on ("package"))
+              (:file "compress" :depends-on ("package"))
               ))))
 
 (defmethod perform ((o test-op) (c (eql (find-system :uffi-tests))))