~ chicken-core (chicken-5) 073d86499655d357499ba4542951480ca721ffca
commit 073d86499655d357499ba4542951480ca721ffca Author: felix <felix@call-with-current-continuation.org> AuthorDate: Fri Nov 3 14:45:07 2017 +0100 Commit: felix <felix@call-with-current-continuation.org> CommitDate: Fri Nov 3 14:45:07 2017 +0100 fixed some tests diff --git a/tests/arithmetic-test.scm b/tests/arithmetic-test.scm index a3d37354..137e219c 100644 --- a/tests/arithmetic-test.scm +++ b/tests/arithmetic-test.scm @@ -15,7 +15,7 @@ (else)) -(import pretty-print random (chicken platform)) +(import pretty-print (chicken random) (chicken platform)) (define range 2) (define random-range 32000) @@ -34,8 +34,8 @@ (expt 2 32))) (cond-expand - (fully-random (randomize)) - (else (randomize 42))) + (fully-random) + (else (set-pseudo-random-seed! "abcdefgh"))) (define (push c total opname args res) (let ((x (list (cons c total) (cons opname args) '-> res))) @@ -71,7 +71,8 @@ (lambda (y) (do ((i 10 (sub1 i))) ((zero? i)) - (let* ((args (list (+ x (random random-range)) (+ y (random random-range)))) + (let* ((args (list (+ x (pseudo-random-integer random-range)) + (+ y (pseudo-random-integer random-range)))) (res (and (cond-expand (fx-ops diff --git a/tests/loopy-loop.scm b/tests/loopy-loop.scm index 310afcc6..dd5a1409 100644 --- a/tests/loopy-loop.scm +++ b/tests/loopy-loop.scm @@ -325,22 +325,23 @@ (syntax-rules () ((in-random ((var) ()) next . rest) ; XXXX consider in-random-real (next ((MAX_RAND (+ (expt 2 29) (- (expt 2 29) 1)))) - ((var (/ (random MAX_RAND) MAX_RAND) - (/ (random MAX_RAND) MAX_RAND))) + ((var (/ (pseudo-random-integer MAX_RAND) MAX_RAND) + (/ (pseudo-random-integer MAX_RAND) MAX_RAND))) () () . rest)) ((in-random ((var) (n)) next . rest) (next ((tmp-n n)) - ((var (random tmp-n) (random tmp-n))) + ((var (pseudo-random-integer tmp-n) + (pseudo-random-integer tmp-n))) () () () . rest)) ((in-random ((var) (n lo)) next . rest) (next ((tmp-n n) (tmp-lo lo)) - ((var (+ tmp-lo (random tmp-n)) - (+ tmp-lo (random tmp-n)))) + ((var (+ tmp-lo (pseudo-random-integer tmp-n)) + (+ tmp-lo (pseudo-random-integer tmp-n)))) () () () @@ -357,8 +358,8 @@ (list->vector tmp-source) tmp-source)) (tmp-len (vector-length tmp-vec))) - ((var (vector-ref tmp-vec (random tmp-len)) - (vector-ref tmp-vec (random tmp-len)))) + ((var (vector-ref tmp-vec (pseudo-random-integer tmp-len)) + (vector-ref tmp-vec (pseudo-random-integer tmp-len)))) () () ()Trap