Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ansi-test
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Michał Herda
ansi-test
Commits
41aecc44
Commit
41aecc44
authored
21 years ago
by
pfdietz
Browse files
Options
Downloads
Patches
Plain Diff
Added tests for sinh, cosh.
parent
94ef088b
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
ansi-tests/cosh.lsp
+98
-0
98 additions, 0 deletions
ansi-tests/cosh.lsp
ansi-tests/load-numbers.lsp
+4
-0
4 additions, 0 deletions
ansi-tests/load-numbers.lsp
ansi-tests/sinh.lsp
+95
-0
95 additions, 0 deletions
ansi-tests/sinh.lsp
with
197 additions
and
0 deletions
ansi-tests/cosh.lsp
0 → 100644
+
98
−
0
View file @
41aecc44
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Wed Feb 11 06:54:15 2004
;;;; Contains: Tests of COSH
(in-package :cl-test)
(deftest cosh.1
(let ((result (cosh 0)))
(or (eqlt result 1)
(eqlt result 1.0)))
t)
(deftest cosh.2
(loop for type in '(short-float single-float double-float long-float)
for zero = (coerce 0 type)
for one = (coerce 1 type)
unless (equal (multiple-value-list (cosh zero))
(list one))
collect type)
nil)
(deftest cosh.3
(loop for type in '(short-float single-float double-float long-float)
for zero = (coerce 0 `(complex ,type))
for one = (coerce 1 `(complex ,type))
unless (equal (multiple-value-list (cosh zero))
(list one))
collect type)
nil)
(deftest cosh.4
(loop for den = (1+ (random 10000))
for num = (random (* 10 den))
for x = (/ num den)
for rlist = (multiple-value-list (cosh x))
for y = (car rlist)
repeat 1000
unless (and (null (cdr rlist))
(numberp y))
collect (list x rlist))
nil)
(deftest cosh.5
(loop for type in '(short-float single-float double-float long-float)
nconc
(loop
for x = (- (random (coerce 20 type)) 10)
for rlist = (multiple-value-list (cosh x))
for y = (car rlist)
repeat 1000
unless (and (null (cdr rlist))
(typep y type))
collect (list x rlist)))
nil)
(deftest cosh.6
(loop for type in '(short-float single-float double-float long-float)
nconc
(loop
for x1 = (- (random (coerce 20 type)) 10)
for x2 = (- (random (coerce 20 type)) 10)
for rlist = (multiple-value-list (cosh (complex x1 x2)))
for y = (car rlist)
repeat 1000
unless (and (null (cdr rlist))
(typep y `(complex ,type)))
collect (list x rlist)))
nil)
;;; FIXME
;;; Add accuracy tests here
;;; Error tests
(deftest cosh.error.1
(signals-error (cosh) program-error)
t)
(deftest cosh.error.2
(signals-error (cosh 1.0 1.0) program-error)
t)
(deftest cosh.error.3
(loop for x in *mini-universe*
unless (or (numberp x)
(eval `(signals-error (cosh ',x) type-error)))
collect x)
nil)
This diff is collapsed.
Click to expand it.
ansi-tests/load-numbers.lsp
+
4
−
0
View file @
41aecc44
...
...
@@ -31,6 +31,10 @@
(load "acos.lsp")
(load "atan.lsp")
(load "sinh.lsp")
(load "cosh.lsp")
(load "times.lsp")
(load "plus.lsp")
(load "minus.lsp")
...
...
This diff is collapsed.
Click to expand it.
ansi-tests/sinh.lsp
0 → 100644
+
95
−
0
View file @
41aecc44
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Wed Feb 11 06:29:51 2004
;;;; Contains: Tests for SINH
(in-package :cl-test)
(deftest sinh.1
(let ((result (sinh 0)))
(or (eqlt result 0)
(eqlt result 0.0)))
t)
(deftest sinh.2
(loop for type in '(short-float single-float double-float long-float)
for zero = (coerce 0 type)
unless (equal (multiple-value-list (sinh zero))
(list zero))
collect type)
nil)
(deftest sinh.3
(loop for type in '(short-float single-float double-float long-float)
for zero = (coerce 0 `(complex ,type))
unless (equal (multiple-value-list (sinh zero))
(list zero))
collect type)
nil)
(deftest sinh.4
(loop for den = (1+ (random 10000))
for num = (random (* 10 den))
for x = (/ num den)
for rlist = (multiple-value-list (sinh x))
for y = (car rlist)
repeat 1000
unless (and (null (cdr rlist))
(numberp y))
collect (list x rlist))
nil)
(deftest sinh.5
(loop for type in '(short-float single-float double-float long-float)
nconc
(loop
for x = (- (random (coerce 20 type)) 10)
for rlist = (multiple-value-list (sinh x))
for y = (car rlist)
repeat 1000
unless (and (null (cdr rlist))
(typep y type))
collect (list x rlist)))
nil)
(deftest sinh.6
(loop for type in '(short-float single-float double-float long-float)
nconc
(loop
for x1 = (- (random (coerce 20 type)) 10)
for x2 = (- (random (coerce 20 type)) 10)
for rlist = (multiple-value-list (sinh (complex x1 x2)))
for y = (car rlist)
repeat 1000
unless (and (null (cdr rlist))
(typep y `(complex ,type)))
collect (list x rlist)))
nil)
;;; FIXME
;;; Add accuracy tests here
;;; Error tests
(deftest sinh.error.1
(signals-error (sinh) program-error)
t)
(deftest sinh.error.2
(signals-error (sinh 1.0 1.0) program-error)
t)
(deftest sinh.error.3
(loop for x in *mini-universe*
unless (or (numberp x)
(eval `(signals-error (sinh ',x) type-error)))
collect x)
nil)
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