source: trunk/tests/ansi-tests/exp.lsp @ 10943

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

Comment out exp.error.6 and exp.error.7 in this branch

File size: 1.8 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(deftest exp.error.4
45  (signals-error (exp (+ (log most-positive-short-float) 100))
46                 floating-point-overflow)
47  t)
48
49(deftest exp.error.5
50  (signals-error (exp (+ (log most-positive-single-float) 100))
51                 floating-point-overflow)
52  t)
53
54#-ccl-0711
55(deftest exp.error.6
56  (signals-error (exp (+ (log most-positive-double-float) 100))
57                 floating-point-overflow)
58  t)
59
60#-ccl-0711
61(deftest exp.error.7
62  (signals-error (exp (+ (log most-positive-long-float) 100))
63                 floating-point-overflow)
64  t)
65
66#+bogus-test
67(deftest exp.error.8
68  (signals-error (exp (- (log least-positive-short-float) 100))
69                 floating-point-underflow)
70  t)
71
72#+bogus-test
73(deftest exp.error.9
74  (signals-error (exp (- (log least-positive-single-float) 100))
75                 floating-point-underflow)
76  t)
77
78#+bogus-test
79(deftest exp.error.10
80  (signals-error (exp (- (log least-positive-double-float) 100))
81                 floating-point-underflow)
82  t)
83
84#+bogus-test
85(deftest exp.error.11
86  (signals-error (exp (- (log least-positive-double-float) 100))
87                 floating-point-underflow)
88  t)
Note: See TracBrowser for help on using the repository browser.