]> gitweb.factorcode.org Git - factor.git/blob - extra/random/cmwc/cmwc-tests.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / extra / random / cmwc / cmwc-tests.factor
1 ! Copyright (C) 2009 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien.c-types arrays kernel random random.cmwc sequences
4 specialized-arrays specialized-arrays.instances.uint tools.test ;
5 IN: random.cmwc.tests
6
7 [ ] [
8     cmwc-4096 [
9         random-32 drop
10     ] with-random
11 ] unit-test
12
13 [
14 {
15     4294604858
16     4294948512
17     4294929730
18     4294910948
19     4294892166
20     4294873384
21     4294854602
22     4294835820
23     4294817038
24     4294798256
25 }
26 ] [
27     cmwc-4096
28     4096 iota >uint-array 362436 <cmwc-seed> seed-random [
29         10 [ random-32 ] replicate
30     ] with-random
31 ] unit-test
32
33 [ t ] [
34     cmwc-4096 [
35         4096 iota >uint-array 362436 <cmwc-seed> seed-random [
36             10 [ random-32 ] replicate
37         ] with-random
38     ] [
39         4096 iota >uint-array 362436 <cmwc-seed> seed-random [
40             10 [ random-32 ] replicate
41         ] with-random
42     ] bi =
43 ] unit-test