From ba79f3178a41baf9667dc1bd12be7d766d55e475 Mon Sep 17 00:00:00 2001 From: erg Date: Sun, 19 Feb 2006 21:26:27 +0000 Subject: [PATCH] random-tester fixed bugs in random-tester removed debug statement in base64 --- contrib/crypto/base64.factor | 1 - contrib/random-tester/random-tester.factor | 22 ++++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/contrib/crypto/base64.factor b/contrib/crypto/base64.factor index 87a52f8493..2e4dda6250 100644 --- a/contrib/crypto/base64.factor +++ b/contrib/crypto/base64.factor @@ -15,7 +15,6 @@ IN: crypto-internals "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" nth ; : base64>ch ( ch -- ch ) - #! extra f is to adjust index { f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f 62 f f f 63 52 53 54 55 56 57 58 59 60 61 f f diff --git a/contrib/random-tester/random-tester.factor b/contrib/random-tester/random-tester.factor index 77065594e9..5c995d2b0e 100644 --- a/contrib/random-tester/random-tester.factor +++ b/contrib/random-tester/random-tester.factor @@ -35,14 +35,13 @@ IN: random-tester : ratio>x { - 1+ 1- >bignum >digit >fixnum abs absq arg + 1+ 1- >bignum >digit >fixnum abs absq arg ceiling cis conjugate cos cosec cosech cosh cot coth double>bits exp float>bits floor imaginary log neg next-power-of-2 quadrant real sec sech sgn sin sinh sq sqrt tan tanh truncate } ; -! ceiling, truncate, floor eventually : float>x ( float -- x ) { 1+ 1- >bignum >digit >fixnum abs absq arg @@ -198,11 +197,10 @@ SYMBOL: first-arg = [ "problem in runtime" throw ] unless ; : interp-runtime-check ( quot -- ) - dup . - ! 0 [ tan tan ] compile-1 drop + ! dup . [ last-quot set ] keep - [ call ] keep compile-1 - 2dup swap unparse write " " write unparse print + [ call ] keep call ! compile-1 + ! 2dup swap unparse write " " write unparse print = [ "problem in math" throw ] unless ; : interp-compile-check-1 ( x quot -- ) @@ -280,24 +278,24 @@ SYMBOL: first-arg random-ratio ratio>x-throw nth-rand unit cons interp-compile-check-catch ; : test-update-xt ( -- ) - random-integer random-integer 2integer>x nth-rand unit swons swons update-xt-check ; + random-integer random-integer 2integer>x nth-rand unit cons cons update-xt-check ; ! 2-arg tests : test-2integer>x ( -- ) - random-integer random-integer 2integer>x nth-rand unit swons swons interp-runtime-check ; + random-integer random-integer 2integer>x nth-rand unit cons cons interp-runtime-check ; : test-2ratio>x ( -- ) - random-ratio random-ratio 2ratio>x nth-rand unit swons swons interp-runtime-check ; + random-ratio random-ratio 2ratio>x nth-rand unit cons cons interp-runtime-check ; : test-2float>x ( -- ) - random-float random-float 2float>x nth-rand unit swons swons interp-runtime-check ; + random-float random-float 2float>x nth-rand unit cons cons interp-runtime-check ; : test-2complex>x ( -- ) - random-complex random-complex 2complex>x nth-rand unit swons swons interp-runtime-check ; + random-complex random-complex 2complex>x nth-rand unit cons cons interp-runtime-check ; : test-2random>x ( -- ) - random-number random-number math-2 nth-rand unit swons swons interp-runtime-check ; + random-number random-number math-2 nth-rand unit cons cons interp-runtime-check ;