X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests%2Fcompress.lisp;h=fcff615d1bfc79802d7a19383b9190bd19e8871f;hb=886f754686a07aea92089a3ffdc997836d69d9f3;hp=86d840d6e83b7f0e6f50cc22e07b7c686b54274c;hpb=0bf8fb658b7a8181a42792f7cb0de08b91f7a8d3;p=uffi.git diff --git a/tests/compress.lisp b/tests/compress.lisp index 86d840d..fcff615 100644 --- a/tests/compress.lisp +++ b/tests/compress.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: compress.lisp,v 1.5 2003/04/29 12:57:10 kevin Exp $ +;;;; $Id: compress.lisp,v 1.6 2003/04/29 13:16:14 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -91,18 +91,19 @@ (uffi:free-foreign-object destlen) (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"))) +(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)) -;; Results of the above on my system: -;; (compress "") => 789c300001,8 -;; (compress "test") => 789c2b492d2e1045d1c1,12 -;; (compress "test2") => 789c2b492d2e31206501f3,13 +(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")