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

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size:
1.7 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  (inpackage :cltest) 

7  

8  (compileandload "numbersaux.lsp") 

9  (compileandload "expaux.lsp") 

10  

11  ;;; Error tests 

12  

13  (deftest exp.error.1 

14  (signalserror (exp) programerror) 

15  t) 

16  

17  (deftest exp.error.2 

18  (signalserror (exp 0 nil) programerror) 

19  t) 

20  

21  (deftest exp.error.3 

22  (signalserror (exp 0 0 0) programerror) 

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  (signalserror (exp (+ (log mostpositiveshortfloat) 100)) 

46  floatingpointoverflow) 

47  t) 

48  

49  (deftest exp.error.5 

50  (signalserror (exp (+ (log mostpositivesinglefloat) 100)) 

51  floatingpointoverflow) 

52  t) 

53  

54  (deftest exp.error.6 

55  (signalserror (exp (+ (log mostpositivedoublefloat) 100)) 

56  floatingpointoverflow) 

57  t) 

58  

59  (deftest exp.error.7 

60  (signalserror (exp (+ (log mostpositivelongfloat) 100)) 

61  floatingpointoverflow) 

62  t) 

63  

64  (deftest exp.error.8 

65  (signalserror (exp ( (log leastpositiveshortfloat) 100)) 

66  floatingpointunderflow) 

67  t) 

68  

69  (deftest exp.error.9 

70  (signalserror (exp ( (log leastpositivesinglefloat) 100)) 

71  floatingpointunderflow) 

72  t) 

73  

74  (deftest exp.error.10 

75  (signalserror (exp ( (log leastpositivedoublefloat) 100)) 

76  floatingpointunderflow) 

77  t) 

78  

79  (deftest exp.error.11 

80  (signalserror (exp ( (log leastpositivedoublefloat) 100)) 

81  floatingpointunderflow) 

82  t) 

Note: See
TracBrowser
for help on using the repository browser.