Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cl-base64
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nyxt
cl-base64
Commits
e5062989
Commit
e5062989
authored
21 years ago
by
Kevin M. Rosenberg
Browse files
Options
Downloads
Patches
Plain Diff
r5554: *** empty log message ***
parent
4c36b6fb
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
base64.asd
+3
-3
3 additions, 3 deletions
base64.asd
test.lisp
+0
-75
0 additions, 75 deletions
test.lisp
tests.lisp
+52
-48
52 additions, 48 deletions
tests.lisp
with
55 additions
and
126 deletions
base64.asd
+
3
−
3
View file @
e5062989
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
;;;; Programmer: Kevin M. Rosenberg
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Dec 2002
;;;; Date Started: Dec 2002
;;;;
;;;;
;;;; $Id: base64.asd,v 1.2
2
2003/08/2
4 20:38:08
kevin Exp $
;;;; $Id: base64.asd,v 1.2
3
2003/08/2
5 16:27:23
kevin Exp $
;;;; *************************************************************************
;;;; *************************************************************************
(
in-package
#:cl-user
)
(
in-package
#:cl-user
)
...
@@ -37,12 +37,12 @@
...
@@ -37,12 +37,12 @@
(
operate
'test-op
'base64-tests
:force
t
))
(
operate
'test-op
'base64-tests
:force
t
))
(
defsystem
base64-tests
(
defsystem
base64-tests
:depends-on
(
base64
)
:depends-on
(
base64
ptester
)
:components
:components
((
:file
"tests"
)))
((
:file
"tests"
)))
(
defmethod
perform
((
o
test-op
)
(
c
(
eql
(
find-system
'base64-tests
))))
(
defmethod
perform
((
o
test-op
)
(
c
(
eql
(
find-system
'base64-tests
))))
(
operate
'load-op
'base64-tests
)
(
operate
'load-op
'base64-tests
)
(
or
(
funcall
(
intern
(
symbol-name
'
#:test
-base64
)
(
or
(
funcall
(
intern
(
symbol-name
'
#:
do-
test
s
)
(
find-package
'base64-test
)))
(
find-package
'base64-test
)))
(
error
"test-op failed"
)))
(
error
"test-op failed"
)))
This diff is collapsed.
Click to expand it.
test.lisp
deleted
100644 → 0
+
0
−
75
View file @
4c36b6fb
;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
;;;; *************************************************************************
;;;; FILE IDENTIFICATION
;;;;
;;;; Name: test.lisp
;;;; Purpose: Regression tests for cl-base64
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Jan 2003
;;;;
;;;; $Id: test.lisp,v 1.3 2003/06/12 14:05:11 kevin Exp $
;;;; *************************************************************************
(
in-package
#:cl-user
)
(
defpackage
#:base64-test
(
:use
#:cl
#:kmrcl
#:base64
#:util.test
))
(
in-package
#:base64-test
)
(
defun
test-base64
()
(
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
))
(
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
))
;; Test against cl-base64 routines
(
test
integer
(
base64-string-to-integer
(
integer-to-base64-string
integer
:columns
columns
)))
(
test
string
(
base64-string-to-string
(
string-to-base64-string
string
:columns
columns
))
:test
#'
string=
)
;; 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=
))))))
(
defun
time-routines
()
(
let*
((
str
"abcdefghijklmnopqwertyu1234589jhwf2ff"
)
(
usb8
(
string-to-usb8-array
str
))
(
int
12345678901234567890
)
(
n
50000
))
(
time-iterations
n
(
integer-to-base64-string
int
))
(
time-iterations
n
(
excl:integer-to-base64-string
int
))
(
time-iterations
n
(
string-to-base64-string
str
))
(
time-iterations
n
(
excl:usb8-array-to-base64-string
usb8
))))
;;#+run-test (test-base64)
This diff is collapsed.
Click to expand it.
tests.lisp
+
52
−
48
View file @
e5062989
...
@@ -7,56 +7,59 @@
...
@@ -7,56 +7,59 @@
;;;; Programmer: Kevin M. Rosenberg
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Jan 2003
;;;; Date Started: Jan 2003
;;;;
;;;;
;;;; $Id: tests.lisp,v 1.
1
2003/08/2
4 20:38:08
kevin Exp $
;;;; $Id: tests.lisp,v 1.
2
2003/08/2
5 16:27:23
kevin Exp $
;;;; *************************************************************************
;;;; *************************************************************************
(
in-package
#:cl-user
)
(
in-package
#:cl-user
)
(
defpackage
#:base64-test
(
defpackage
#:base64-test
(
:use
#:cl
#:kmrcl
#:base64
)
(
:use
#:cl
#:kmrcl
#:base64
#:ptester
)
)
(
:export
#:test-base64
))
(
in-package
#:base64-test
)
(
in-package
#:base64-test
)
(
defun
test-base64
()
(
defun
do-tests
()
(
do*
((
length
0
(
+
3
length
))
(
with-tests
(
:name
"cl-base64 tests"
)
(
string
(
make-string
length
)
(
make-string
length
))
(
let
((
*break-on-test-failures*
t
))
(
usb8
(
make-usb8-array
length
)
(
make-usb8-array
length
))
(
do*
((
length
0
(
+
3
length
))
(
integer
(
random
(
expt
10
length
))
(
random
(
expt
10
length
))))
(
string
(
make-string
length
)
(
make-string
length
))
((
>=
length
300
))
(
usb8
(
make-usb8-array
length
)
(
make-usb8-array
length
))
(
dotimes
(
i
length
)
(
integer
(
random
(
expt
10
length
))
(
random
(
expt
10
length
))))
(
declare
(
fixnum
i
))
((
>=
length
300
))
(
let
((
code
(
random
256
)))
(
dotimes
(
i
length
)
(
setf
(
schar
string
i
)
(
code-char
code
))
(
declare
(
fixnum
i
))
(
let
((
code
(
random
256
)))
(
setf
(
schar
string
i
)
(
code-char
code
))
(
setf
(
aref
usb8
i
)
code
)))
(
setf
(
aref
usb8
i
)
code
)))
(
do*
((
columns
0
(
+
columns
4
)))
(
do*
((
columns
0
(
+
columns
4
)))
((
>
columns
length
))
((
>
columns
length
))
;; Test against cl-base64 routines
;; Test against cl-base64 routines
(
as
sert
(
=
integer
(
test
integer
(
b
as
e64-string-to-
integer
(
base64-string
-to-
integer
(
integer-to-
base64-string
integer
:columns
columns
)))
(
integer-to-base64-string
integer
:columns
columns
))))
(
test
string
(
base64-string-to-string
(
assert
(
string
=
string
(
string-to-base64-
string
string
:columns
columns
))
(
base64-string-to-
string
:test
#'
string
=
)
(
string-to-base64-string
string
:columns
columns
))))
;; Test against AllegroCL built-in routines
;; Test against AllegroCL built-in routines
#+
allegro
#+
allegro
(
progn
(
progn
(
test
integer
(
excl:base64-string-to-integer
(
assert
(
=
integer
(
excl:
base64-string
-to-
integer
(
integer-to-
base64-string
integer
:columns
columns
)))
(
integer
-to-
base64-string
integer
:columns
columns
))))
(
test
integer
(
base64-string
-to-
integer
(
assert
(
=
integer
(
base64-string
-to-
integer
(
excl:
integer
-to-
base64-string
integer
)))
(
excl:integer-to-base64-string
integer
)))
)
(
test
(
string-to-base64-string
string
:columns
columns
)
(
assert
(
string=
(
string-to-base64-string
string
:columns
columns
)
(
excl:usb8-array-to-base64-string
usb8
(
excl:usb8-array-to-base64-string
usb8
(
if
(
zerop
columns
)
(
if
(
zerop
columns
)
nil
nil
columns
))
columns
)))
)
:test
#'
string=
)
(
assert
(
string=
string
(
base64-string-to-string
(
test
string
(
base64-string-to-string
(
excl:usb8-array-to-base64-string
(
excl:usb8-array-to-base64-string
usb8
usb8
(
if
(
zerop
columns
)
(
if
(
zerop
columns
)
nil
nil
columns
)))
)))))
columns
)))
(
format
t
"~&All tests passed~%"
)
:test
#'
string=
)))))
)
t
)
t
)
...
@@ -66,10 +69,11 @@
...
@@ -66,10 +69,11 @@
(
int
12345678901234567890
)
(
int
12345678901234567890
)
(
n
50000
))
(
n
50000
))
(
time-iterations
n
(
integer-to-base64-string
int
))
(
time-iterations
n
(
integer-to-base64-string
int
))
#+
allegro
(
time-iterations
n
(
excl:integer-to-base64-string
int
))
(
time-iterations
n
(
string-to-base64-string
str
))
(
time-iterations
n
(
string-to-base64-string
str
))
#+
allegro
#+
allego
(
time-iterations
n
(
excl:usb8-array-to-base64-string
usb8
))))
(
progn
(
time-iterations
n
(
excl:integer-to-base64-string
int
))
(
time-iterations
n
(
excl:usb8-array-to-base64-string
usb8
)))))
;;(test-base64)
;;#+run-test (test-base64)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment