]> gitweb.factorcode.org Git - factor.git/blob - extra/random/cmwc/cmwc-tests.factor
specialized-arrays: performed some cleanup.
[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 alien.data arrays kernel random random.cmwc
4 sequences specialized-arrays tools.test ;
5 SPECIALIZED-ARRAY: uint
6 IN: random.cmwc.tests
7
8 [ ] [
9     cmwc-4096 [
10         random-32 drop
11     ] with-random
12 ] unit-test
13
14 [
15 {
16     4294604858
17     4294948512
18     4294929730
19     4294910948
20     4294892166
21     4294873384
22     4294854602
23     4294835820
24     4294817038
25     4294798256
26 }
27 ] [
28     cmwc-4096
29     4096 iota uint >c-array 362436 <cmwc-seed> seed-random [
30         10 [ random-32 ] replicate
31     ] with-random
32 ] unit-test
33
34 [ t ] [
35     cmwc-4096 [
36         4096 iota uint >c-array 362436 <cmwc-seed> seed-random [
37             10 [ random-32 ] replicate
38         ] with-random
39     ] [
40         4096 iota uint >c-array 362436 <cmwc-seed> seed-random [
41             10 [ random-32 ] replicate
42         ] with-random
43     ] bi =
44 ] unit-test