source: trunk/tests/ansi-tests/exp.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: 1.9 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Mon Sep  1 21:24:44 2003
4;;;; Contains: Tests of EXP
5
6(in-package :cl-test)
7
8(compile-and-load "numbers-aux.lsp")
9(compile-and-load "exp-aux.lsp")
10
11;;; Error tests
12
13(deftest exp.error.1
14  (signals-error (exp) program-error)
15  t)
16
17(deftest exp.error.2
18  (signals-error (exp 0 nil) program-error)
19  t)
20
21(deftest exp.error.3
22  (signals-error (exp 0 0 0) program-error)
23  t)
24
25;;; Other tests
26
27(deftest exp.1
28  (let ((result (exp 0)))
29    (or (eqlt result 1)
30        (eqlt result 1.0f0)))
31  t)
32
33(deftest exp.2
34  (mapcar #'exp '(0.0s0 0.0f0 0.0d0 0.0l0))
35  (1.0s0 1.0f0 1.0d0 1.0l0))
36
37(deftest exp.3
38  (mapcar #'exp '(-0.0s0 -0.0f0 -0.0d0 -0.0l0))
39  (1.0s0 1.0f0 1.0d0 1.0l0))
40
41;;; FIXME
42;;; Add more tests here for floating point accuracy
43
44#+(or (not darwin-target) known-bug-274)
45(deftest exp.error.4
46  (signals-error (exp (+ (log most-positive-short-float) 100))
47                 floating-point-overflow)
48  t)
49
50#+(or (not darwin-target) known-bug-274)
51(deftest exp.error.5
52  (signals-error (exp (+ (log most-positive-single-float) 100))
53                 floating-point-overflow)
54  t)
55
56#+(or (not darwin-target) known-bug-274)
57(deftest exp.error.6
58  (signals-error (exp (+ (log most-positive-double-float) 100))
59                 floating-point-overflow)
60  t)
61
62#+(or (not darwin-target) known-bug-274)
63(deftest exp.error.7
64  (signals-error (exp (+ (log most-positive-long-float) 100))
65                 floating-point-overflow)
66  t)
67
68#+bogus-test
69(deftest exp.error.8
70  (signals-error (exp (- (log least-positive-short-float) 100))
71                 floating-point-underflow)
72  t)
73
74#+bogus-test
75(deftest exp.error.9
76  (signals-error (exp (- (log least-positive-single-float) 100))
77                 floating-point-underflow)
78  t)
79
80#+bogus-test
81(deftest exp.error.10
82  (signals-error (exp (- (log least-positive-double-float) 100))
83                 floating-point-underflow)
84  t)
85
86#+bogus-test
87(deftest exp.error.11
88  (signals-error (exp (- (log least-positive-double-float) 100))
89                 floating-point-underflow)
90  t)
Note: See TracBrowser for help on using the repository browser.