Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing/quick: generate full 64-bit random int64s #19808

Closed
rsc opened this issue Mar 31, 2017 · 1 comment
Closed

testing/quick: generate full 64-bit random int64s #19808

rsc opened this issue Mar 31, 2017 · 1 comment
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Mar 31, 2017

When generating a random int8, uint8, int16, uint16, int32, uint32,
quick.Value chooses among all possible values.

But when generating a random int64 or uint64, it only chooses
values in the range [-2⁶², 2⁶²) (even for uint64).
It should, like for all the other integers, use the full range.

If it had, this would have caught #19807.

CL on its way.

@gopherbot
Copy link

CL https://golang.org/cl/39152 mentions this issue.

lparth pushed a commit to lparth/go that referenced this issue Apr 13, 2017
When generating a random int8, uint8, int16, uint16, int32, uint32,
quick.Value chooses among all possible values.

But when generating a random int64 or uint64, it only chooses
values in the range [-2⁶², 2⁶²) (even for uint64).
It should, like for all the other integers, use the full range.

If it had, this would have caught golang#19807 earlier.
Instead it let us discover the presence of golang#19809.

While we are here, also make the default source of
randomness not completely deterministic.

Fixes golang#19808.

Change-Id: I070f852531c92b3670bd76523326c9132bfc9416
Reviewed-on: https://go-review.googlesource.com/39152
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
@golang golang locked and limited conversation to collaborators Apr 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants