From: Kevin M. Rosenberg Date: Tue, 29 Apr 2003 13:16:14 +0000 (+0000) Subject: r4702: *** empty log message *** X-Git-Tag: v1.6.1~227 X-Git-Url: http://git.kpe.io/?p=uffi.git;a=commitdiff_plain;h=886f754686a07aea92089a3ffdc997836d69d9f3 r4702: *** empty log message *** --- 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") diff --git a/uffi-tests.asd b/uffi-tests.asd index d3c9ccc..0bf6ab3 100644 --- a/uffi-tests.asd +++ b/uffi-tests.asd @@ -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))))