[git] CMU Common Lisp branch master updated. snapshot-2013-12-a-15-g7916cfb
Raymond Toy
rtoy at common-lisp.net
Wed Dec 18 16:50:44 UTC 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMU Common Lisp".
The branch, master has been updated
via 7916cfb0b1b01e42901d92d9669c3c6099a6cab6 (commit)
from 9c4bcc617b25fdcbac0bd8372cdc545dfa1f0bd7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7916cfb0b1b01e42901d92d9669c3c6099a6cab6
Author: Raymond Toy <toy.raymond at gmail.com>
Date: Wed Dec 18 08:50:37 2013 -0800
Add more tests for exceptional values for cos and tan. Add a few
comments.
diff --git a/src/tests/trig.lisp b/src/tests/trig.lisp
index 41e444a..58d10b6 100644
--- a/src/tests/trig.lisp
+++ b/src/tests/trig.lisp
@@ -1,3 +1,5 @@
+;;; Tests for the basic trig functions, now implemented in Lisp.
+
(defpackage :trig-tests
(:use :cl :lisp-unit))
@@ -52,8 +54,10 @@
"Test sin for exceptional values"
(:tag :sin :exceptions)
(kernel::with-float-traps-masked ()
- (assert-error 'floating-point-invalid-operation (sin ext:double-float-positive-infinity))
- (assert-error 'floating-point-invalid-operation (sin ext:double-float-negative-infinity))))
+ (assert-error 'floating-point-invalid-operation
+ (sin ext:double-float-positive-infinity))
+ (assert-error 'floating-point-invalid-operation
+ (sin ext:double-float-negative-infinity))))
(define-test cos.signed-zeroes
"Test cos for 0d0 and -0d0"
@@ -104,6 +108,15 @@
(assert-eql -0.9258790228548379d0
(cos (scale-float 1d0 120))))
+(define-test cos.exceptions
+ "Test cos for exceptional values"
+ (:tag :sin :exceptions)
+ (kernel::with-float-traps-masked ()
+ (assert-error 'floating-point-invalid-operation
+ (cos ext:double-float-positive-infinity))
+ (assert-error 'floating-point-invalid-operation
+ (cos ext:double-float-negative-infinity))))
+
(define-test tan.signed-zeroes
"Test tan for 0d0 and -0d0"
(:tag :tan :signed-zeroes)
@@ -150,6 +163,14 @@
(assert-eql -4.08066388841804238545143494525595117765084022768d-1
(tan (scale-float 1d0 120))))
+(define-test tan.exceptions
+ "Test tan for exceptional values"
+ (:tag :sin :exceptions)
+ (kernel::with-float-traps-masked ()
+ (assert-error 'floating-point-invalid-operation
+ (tan ext:double-float-positive-infinity))
+ (assert-error 'floating-point-invalid-operation
+ (tan ext:double-float-negative-infinity))))
(define-test sincos.signed-zeroes
"Test sincos at 0d0, -0d0"
@@ -159,6 +180,9 @@
(assert-equal '(-0d0 1d0)
(multiple-value-list (kernel::%sincos -0d0))))
+;; Test sincos at a bunch of random points and compare the result from
+;; sin and cos. If they differ, save the result in a list to be
+;; returned.
(defun sincos-test (limit n)
(let (results)
(dotimes (k n)
-----------------------------------------------------------------------
Summary of changes:
src/tests/trig.lisp | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
hooks/post-receive
--
CMU Common Lisp
More information about the cmucl-cvs
mailing list