source: trunk/tests/ansi-tests/asin.lsp @ 9045

Last change on this file since 9045 was 9045, checked in by gz, 12 years ago

Assorted cleanup:

In infrastructure:

  • add *test-verbose* and :verbose argument to do-test and do-tests. Avoid random output if false, only show failures
  • muffle-wawrnings and/or bind *suppress-compiler-warnings* in some tests that unavoidably generate them (mainly with duplicate typecase/case clauses)
  • Add record-source-file for tests so meta-. can find them
  • If *catch-errors* (or the :catch-errors arg) is :break, enter a breakloop when catch an error
  • Make test fns created by *compile-tests* have names, so can find them in backtraces
  • fix misc compiler warnings
  • Fixed cases of duplicate test numbers
  • Disable note :make-condition-with-compound-name for openmcl.

In tests themselves:

I commented out the following tests with #+bogus-test, because they just seemed wrong to me:

lambda.47
lambda.50
upgraded-array-element-type.8
upgraded-array-element-type.nil.1
pathname-match-p.5
load.17
load.18
macrolet.47
ctypecase.15

In addition, I commented out the following tests with #+bogus-test because I was too lazy to make a note
for "doesn't signal underflow":

exp.error.8 exp.error.9 exp.error.10 exp.error.11 expt.error.8 expt.error.9 expt.error.10 expt.error.11

Finally, I entered bug reports in trac, and then commented out the tests
below with #+known-bug-NNN, where nnn is the ticket number in trac:

ticket#268: encode-universal-time.3 encode-universal-time.3.1
ticket#269: macrolet.36
ticket#270: values.20 values.21
ticket#271: defclass.error.13 defclass.error.22
ticket#272: phase.10 phase.12 asin.5 asin.6 asin.8
ticket#273: phase.18 phase.19 acos.8
ticket#274: exp.error.4 exp.error.5 exp.error.6 exp.error.7
ticket#275: car.error.2 cdr.error.2
ticket#276: map.error.11
ticket#277: subtypep.cons.43
ticket#278: subtypep-function.3
ticket#279: subtypep-complex.8
ticket#280: open.output.19 open.io.19 file-position.8 file-length.4 file-length.5 read-byte.4 stream-element-type.2 stream-element-type.3
ticket#281: open.65
ticket#288: set-syntax-from-char.sharp.1

File size: 2.4 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Wed Feb 11 05:59:43 2004
4;;;; Contains: Tests for ASIN
5
6(in-package :cl-test)
7
8(deftest asin.1
9  (loop for i from -1000 to 1000
10        for rlist = (multiple-value-list (asin i))
11        for y = (car rlist)
12        always (and (null (cdr rlist))
13                    (numberp y)))
14  t)
15
16(deftest asin.2
17  (loop for type in '(short-float single-float double-float long-float)
18        collect
19        (let ((a (coerce 2000 type))
20              (b (coerce -1000 type)))
21          (loop for x = (- (random a) b)
22                for rlist = (multiple-value-list (asin x))
23                for y = (car rlist)
24                repeat 1000
25                always (and (null (cdr rlist))
26                            (numberp y)))))
27  (t t t t))
28
29(deftest asin.3
30  (loop for type in '(integer short-float single-float double-float long-float)
31        collect
32        (let ((a (coerce 2000 type))
33              (b (coerce -1000 type)))
34          (loop for x = (- (random a) b)
35                for rlist = (multiple-value-list (asin (complex 0 x)))
36                for y = (car rlist)
37                repeat 1000
38                always (and (null (cdr rlist))
39                            (numberp y)))))
40  (t t t t t))
41
42(deftest asin.4
43  (loop for type in '(integer short-float single-float double-float long-float)
44        collect
45        (let ((a (coerce 2000 type))
46              (b (coerce -1000 type)))
47          (loop for x1 = (- (random a) b)
48                for x2 = (- (random a) b)
49                for rlist = (multiple-value-list (asin (complex x1 x2)))
50                for y = (car rlist)
51                repeat 1000
52                always (and (null (cdr rlist))
53                            (numberp y)))))
54  (t t t t t))
55
56#+known-bug-272
57(deftest asin.5
58  (approx= (asin 1) (coerce (/ pi 2) 'single-float))
59  t)
60
61#+known-bug-272
62(deftest asin.6
63  (loop for type in '(single-float short-float double-float long-float)
64        unless (approx= (asin (coerce 1 type))
65                        (coerce (/ pi 2) type))
66        collect type)
67  nil)
68
69(deftest asin.7
70  (loop for type in '(single-float short-float double-float long-float)
71        unless (approx= (asin (coerce 0 type))
72                        (coerce 0 type))
73        collect type)
74  nil)
75
76#+known-bug-272
77(deftest asin.8
78  (loop for type in '(single-float short-float double-float long-float)
79        unless (approx= (asin (coerce -1 type))
80                        (coerce (/ pi -2) type))
81        collect type)
82  nil)
83
84(deftest asin.9
85  (macrolet ((%m (z) z)) (asin (expand-in-current-env (%m 0.0))))
86  0.0)
87
88;;; FIXME
89;;; Add accuracy tests
90
91;;; Error tests
92
93(deftest asin.error.1
94  (signals-error (asin) program-error)
95  t)
96
97(deftest asin.error.2
98  (signals-error (asin 0.0 0.0) program-error)
99  t)
100
101(deftest asin.error.3
102  (check-type-error #'asin #'numberp)
103  nil)
104
105
106
107
108
Note: See TracBrowser for help on using the repository browser.