Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl-copy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Richard M Kreuter
cmucl-copy
Commits
f5df8745
Commit
f5df8745
authored
7 years ago
by
Raymond Toy
Browse files
Options
Downloads
Patches
Plain Diff
Update tests to match xoroshiro implementation.
parent
b8d326cc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/rng.lisp
+10
-10
10 additions, 10 deletions
tests/rng.lisp
with
10 additions
and
10 deletions
tests/rng.lisp
+
10
−
10
View file @
f5df8745
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
(
in-package
"RNG-TESTS"
)
(
in-package
"RNG-TESTS"
)
(
defun
64-bit-rng-state
(
rng
)
(
defun
64-bit-rng-state
(
rng
)
(
let
((
state
(
kernel::
xoro-
random-state-state
rng
)))
(
let
((
state
(
kernel::random-state-state
rng
)))
(
flet
((
convert
(
x
)
(
flet
((
convert
(
x
)
(
multiple-value-bind
(
hi
lo
)
(
multiple-value-bind
(
hi
lo
)
(
kernel:double-float-bits
x
)
(
kernel:double-float-bits
x
)
...
@@ -15,29 +15,29 @@
...
@@ -15,29 +15,29 @@
(
values
(
convert
(
aref
state
0
))
(
convert
(
aref
state
1
))))))
(
values
(
convert
(
aref
state
0
))
(
convert
(
aref
state
1
))))))
(
defun
64-bit-value
(
rng
)
(
defun
64-bit-value
(
rng
)
(
logior
(
ash
(
kernel::
xoroshiro
-chunk
rng
)
32
)
(
logior
(
ash
(
kernel::
random
-chunk
rng
)
32
)
(
kernel::
xoroshiro
-chunk
rng
)))
(
kernel::
random
-chunk
rng
)))
(
defvar
*test-state*
)
(
defvar
*test-state*
)
(
define-test
rng.initial-state
(
define-test
rng.initial-state
(
setf
*test-state*
(
setf
*test-state*
(
kernel::make-
xoroshiro
-object
:state
(
kernel::init-
xoro
-state
#x12345678
)
(
kernel::make-
random
-object
:state
(
kernel::init-
random
-state
#x12345678
)
:rand
0
:rand
0
:cached-p
nil
))
:cached-p
nil
))
(
multiple-value-bind
(
s0
s1
)
(
multiple-value-bind
(
s0
s1
)
(
64-bit-rng-state
*test-state*
)
(
64-bit-rng-state
*test-state*
)
(
assert-equal
#x38f1dc39d1906b6f
s0
)
(
assert-equal
#x38f1dc39d1906b6f
s0
)
(
assert-equal
#xdfe4142236dd9517
s1
)
(
assert-equal
#xdfe4142236dd9517
s1
)
(
assert-equal
0
(
kernel::
xoro-
random-state-rand
*test-state*
))
(
assert-equal
0
(
kernel::random-state-rand
*test-state*
))
(
assert-equal
nil
(
kernel::
xoro-
random-state-cached-p
*test-state*
))))
(
assert-equal
nil
(
kernel::random-state-cached-p
*test-state*
))))
(
define-test
rng.values-test
(
define-test
rng.values-test
(
assert-equal
(
list
#x38f1dc39d1906b6f
#xdfe4142236dd9517
)
(
assert-equal
(
list
#x38f1dc39d1906b6f
#xdfe4142236dd9517
)
(
multiple-value-list
(
64-bit-rng-state
*test-state*
)))
(
multiple-value-list
(
64-bit-rng-state
*test-state*
)))
(
assert-equal
0
(
kernel::
xoro-
random-state-rand
*test-state*
))
(
assert-equal
0
(
kernel::random-state-rand
*test-state*
))
(
assert-equal
nil
(
kernel::
xoro-
random-state-cached-p
*test-state*
))
(
assert-equal
nil
(
kernel::random-state-cached-p
*test-state*
))
(
dolist
(
item
'
((
#x18d5f05c086e0086
(
#x228f4926843b364d
#x74dfe78e715c81be
))
(
dolist
(
item
'
((
#x18d5f05c086e0086
(
#x228f4926843b364d
#x74dfe78e715c81be
))
(
#x976f30b4f597b80b
(
#x5b6bd4558bd96a68
#x567b7f35650aea8f
))
(
#x976f30b4f597b80b
(
#x5b6bd4558bd96a68
#x567b7f35650aea8f
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment