From: Taylor R Campbell Date: Wed, 28 Nov 2018 05:33:23 +0000 (+0000) Subject: Re-enable invalid-operation traps here and fix the one broken test. X-Git-Tag: mit-scheme-pucked-10.1.7~3^2~150 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=da93315e8529154f67f6c3a9667585dd18fe5d21;p=mit-scheme.git Re-enable invalid-operation traps here and fix the one broken test. Should maybe add a flo:safe-zero?, or decide that flo:zero? is the quiet version and (flo:= x 0.) is the signalling one. --- diff --git a/tests/runtime/test-flonum.scm b/tests/runtime/test-flonum.scm index ef380e254..4fb01afe2 100644 --- a/tests/runtime/test-flonum.scm +++ b/tests/runtime/test-flonum.scm @@ -41,12 +41,10 @@ USA. (f))) (define (yes-traps f) - #; (if (flo:have-trap-enable/disable?) - (flo:with-trapped-exceptions (flo:trappable-exceptions) f) - (f)) - ;; XXX Temporary workaround for my setup. - (no-traps f)) + ;; XXX Should enable all traps. + (flo:with-trapped-exceptions (flo:exception:invalid-operation) f) + (f))) (define subnormal+ flo:smallest-positive-subnormal) (define subnormal- (no-traps (lambda () (- subnormal+)))) @@ -104,10 +102,15 @@ USA. (,subnormal+ #f) (+1. #f) (+inf.0 #f) - (+nan.0 #f)) + ;; (+nan.0 #f) ; exception + ) (lambda (x v) (assert-eqv (yes-traps (lambda () (flo:zero? x))) v))) +(define-test 'nan-is-not-zero + (lambda () + (assert-false (no-traps (lambda () (flo:zero? (flo:nan.0))))))) + (define-enumerated-test 'subnormal? `((-inf.0 #f) (-1. #f)