Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
d1f2d073
Commit
d1f2d073
authored
Jun 25, 2013
by
antirez
Browse files
Test: randomInt() behavior commented.
parent
7e5be50c
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/support/util.tcl
View file @
d1f2d073
...
@@ -91,10 +91,12 @@ proc wait_for_sync r {
...
@@ -91,10 +91,12 @@ proc wait_for_sync r {
}
}
}
}
# Random integer between 0 and max
(
excluded
)
.
proc randomInt
{
max
}
{
proc randomInt
{
max
}
{
expr
{
int
(
rand
()
*$max
)}
expr
{
int
(
rand
()
*$max
)}
}
}
# Random signed integer between -max and max
(
both extremes excluded
)
.
proc randomSignedInt
{
max
}
{
proc randomSignedInt
{
max
}
{
set i
[
randomInt $max
]
set i
[
randomInt $max
]
if
{
rand
()
> 0.5
}
{
if
{
rand
()
> 0.5
}
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment