Skip to content
Snippets Groups Projects
Commit e0713e35 authored by Kevin M. Rosenberg's avatar Kevin M. Rosenberg
Browse files

r4497: Auto commit for Debian build

parent 268e0797
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Jan 2003
;;;;
;;;; $Id: base64-tests.lisp,v 1.9 2003/04/15 16:15:21 kevin Exp $
;;;; $Id: base64-tests.lisp,v 1.10 2003/04/15 16:21:43 kevin Exp $
;;;; *************************************************************************
(in-package :cl-user)
......@@ -19,48 +19,44 @@
(defun test-base64 ()
(setq *break-on-test-failures* t)
(with-tests (:name "cl-base64 tests")
(do* ((length 0 (+ 3 length))
(string (make-string length) (make-string length))
(usb8 (make-usb8-array length) (make-usb8-array length))
(integer (random (expt 10 length)) (random (expt 10 length))))
((>= length 300))
(do* ((length 0 (+ 3 length))
(string (make-string length) (make-string length))
(usb8 (make-usb8-array length) (make-usb8-array length))
(integer (random (expt 10 length)) (random (expt 10 length))))
((>= length 300))
(dotimes (i length)
(declare (fixnum i))
(let ((code (random 256)))
(setf (schar string i) (code-char code))
(setf (aref usb8 i) code)))
(do* ((columns 0 (+ columns 4)))
((> columns length))
(do* ((columns 0 (+ columns 4)))
((> columns length))
;; Test against cl-base64 routines
(test integer (base64-string-to-integer
(integer-to-base64-string integer :columns columns))
:test #'eql)
(test string (base64-string-to-string
(string-to-base64-string string :columns columns))
:test #'string=)
(assert (= integer (base64-string-to-integer
(integer-to-base64-string integer :columns columns))))
(assert (string= (base64-string-to-string
(string-to-base64-string string :columns columns))))
;; Test against AllegroCL built-in routines
#+allegro
(progn
(test integer (excl:base64-string-to-integer
(integer-to-base64-string integer :columns columns)))
(test integer (base64-string-to-integer
(excl:integer-to-base64-string integer)))
(test (string-to-base64-string string :columns columns)
(excl:usb8-array-to-base64-string usb8
(if (zerop columns)
nil
columns))
:test #'string=)
(test string (base64-string-to-string
(excl:usb8-array-to-base64-string
usb8
(if (zerop columns)
nil
columns)))
:test #'string=)))))
(assert (= integer (excl:base64-string-to-integer
(integer-to-base64-string integer :columns columns))))
(assert (= integer (base64-string-to-integer
(excl:integer-to-base64-string integer))))
(assert (string= (string-to-base64-string string :columns columns)
(excl:usb8-array-to-base64-string usb8
(if (zerop columns)
nil
columns))))
(assert (string= string (base64-string-to-string
(excl:usb8-array-to-base64-string
usb8
(if (zerop columns)
nil
columns))))))))
(format t "~&All tests passed~%")
t)
......
......@@ -7,7 +7,7 @@
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Dec 2002
;;;;
;;;; $Id: base64.asd,v 1.18 2003/04/15 16:12:01 kevin Exp $
;;;; $Id: base64.asd,v 1.19 2003/04/15 16:21:43 kevin Exp $
;;;; *************************************************************************
(in-package :asdf)
......@@ -29,7 +29,7 @@
(pushnew :base64 cl:*features*))
;; depends-on only needed for test-op
:depends-on (:kmrcl :tester)
:depends-on (:kmrcl)
:components
((:file "package")
......
......@@ -7,7 +7,7 @@ Standards-Version: 3.5.9.0
Package: cl-base64
Architecture: all
Depends: ${shlibs:Depends}, common-lisp-controller (>= 3.47), cl-kmrcl, cl-tester
Depends: ${shlibs:Depends}, common-lisp-controller (>= 3.47), cl-kmrcl
Description: Common Lisp package to encode and decode base64 with URI support
This package provides highly optimized base64 encoding and decoding.
Besides conversion to and from strings, integer conversions are supported.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment