source: trunk/tests/ansi-tests/phase.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:  Sat Sep  6 21:15:54 2003
4;;;; Contains: Tests of PHASE
5
6(in-package :cl-test)
7
8(deftest phase.error.1
9  (signals-error (phase) program-error)
10  t)
11
12(deftest phase.error.2
13  (signals-error (phase 0 0) program-error)
14  t)
15
16(deftest phase.error.3
17  (check-type-error #'phase #'numberp)
18  nil)
19
20(deftest phase.1
21  (eqlt (phase 0) 0.0f0)
22  t)
23
24(deftest phase.2
25  (eqlt (phase 1) 0.0f0)
26  t)
27
28(deftest phase.3
29  (eqlt (phase 1/2) 0.0f0)
30  t)
31
32(deftest phase.4
33  (eqlt (phase 100.0f0) 0.0f0)
34  t)
35
36(deftest phase.5
37  (eqlt (phase 100.0s0) 0.0s0)
38  t)
39
40(deftest phase.6
41  (eqlt (phase 100.0d0) 0.0d0)
42  t)
43
44(deftest phase.7
45  (eqlt (phase 100.0l0) 0.0l0)
46  t)
47
48(deftest phase.8
49  (eqlt (phase -1) (coerce pi 'single-float))
50  t)
51
52(deftest phase.9
53  (eqlt (phase -1/2) (coerce pi 'single-float))
54  t)
55
56#+known-bug-272
57(deftest phase.10
58  (let ((p1 (phase #c(0 1)))
59        (p2 (phase #c(0.0f0 1.0f0))))
60    (and (eql p1 p2)
61         (approx= p1 (coerce (/ pi 2) 'single-float))))
62  t)
63
64(deftest phase.11
65  (let ((p (phase #c(0.0d0 1.0d0))))
66    (approx= p (coerce (/ pi 2) 'double-float)))
67  t)
68
69#+known-bug-272
70(deftest phase.12
71  (let ((p (phase #c(0.0s0 1.0s0))))
72    (approx= p (coerce (/ pi 2) 'single-float)))
73  t)
74
75(deftest phase.13
76  (let ((p (phase #c(0.0l0 1.0l0))))
77    (approx= p (/ pi 2)))
78  t)
79
80(deftest phase.14
81  (let ((p1 (phase #c(1 1)))
82        (p2 (phase #c(1.0f0 1.0f0))))
83    (and (eql p1 p2)
84         (approx= p1 (coerce (/ pi 4) 'single-float)
85                  (* 2 single-float-epsilon))))
86  t)
87
88(deftest phase.15
89  (let ((p (phase #c(1.0d0 1.0d0))))
90    (approx= p (coerce (/ pi 4) 'double-float)
91             (* 2 double-float-epsilon)))
92  t)
93
94(deftest phase.16
95  (let ((p (phase #c(1.0s0 1.0s0))))
96    (approx= p (coerce (/ pi 4) 'single-float)
97             (* 2 short-float-epsilon)))
98  t)
99
100(deftest phase.17
101  (let ((p (phase #c(1.0l0 1.0l0))))
102    (approx= p (/ pi 4) (* 2 long-float-epsilon)))
103  t)
104
105;;; Negative zeros
106#+(or (not darwin-target) known-bug-273)
107(deftest phase.18
108  (or (eqlt -0.0s0 0.0s0)
109      (approx= (phase #c(-1.0 -0.0)) (coerce (- pi) 'short-float)))
110  t)
111
112#+(or (not darwin-target) known-bug-273)
113(deftest phase.19
114  (or (eqlt -0.0f0 0.0f0)
115      (approx= (phase #c(-1.0 -0.0)) (coerce (- pi) 'single-float)))
116  t)
117
118(deftest phase.20
119  (or (eqlt -0.0d0 0.0d0)
120      (approx= (phase #c(-1.0 -0.0)) (coerce (- pi) 'double-float)))
121  t)
122
123(deftest phase.21
124  (or (eqlt -0.0l0 0.0l0)
125      (approx= (phase #c(-1.0 -0.0)) (coerce (- pi) 'long-float)))
126  t)
Note: See TracBrowser for help on using the repository browser.