aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/test/crypto_SUITE.erl
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2011-09-19 11:04:58 +0200
committerSverker Eriksson <[email protected]>2011-09-19 11:04:58 +0200
commit307c06863caebcd63f98c010a31a0263890af9b4 (patch)
treee47f800cb8b63e886b1b141567e80f24096a3b20 /lib/crypto/test/crypto_SUITE.erl
parent7ebf84abf7e5d06ce9ef6ec11783318aa393093d (diff)
parent02b8d9b4d669ae215b1c2423fa961db1b69a487f (diff)
downloadotp-307c06863caebcd63f98c010a31a0263890af9b4.tar.gz
otp-307c06863caebcd63f98c010a31a0263890af9b4.tar.bz2
otp-307c06863caebcd63f98c010a31a0263890af9b4.zip
Merge branch 'sverker/crypto-rand_uniform-negative/OTP-9526' into dev
* sverker/crypto-rand_uniform-negative/OTP-9526: [crypto] Fix rand_uniform for negative values
Diffstat (limited to 'lib/crypto/test/crypto_SUITE.erl')
-rw-r--r--lib/crypto/test/crypto_SUITE.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl
index 283aadb6ea..8d2f42469b 100644
--- a/lib/crypto/test/crypto_SUITE.erl
+++ b/lib/crypto/test/crypto_SUITE.erl
@@ -878,10 +878,17 @@ rand_uniform_aux_test(0) ->
rand_uniform_aux_test(N) ->
?line L = N*1000,
?line H = N*100000+1,
+ ?line crypto_rand_uniform(L, H),
+ ?line crypto_rand_uniform(-L, L),
+ ?line crypto_rand_uniform(-H, -L),
+ ?line crypto_rand_uniform(-H, L),
+ ?line rand_uniform_aux_test(N-1).
+
+crypto_rand_uniform(L,H) ->
?line R1 = crypto:rand_uniform(L, H),
?line t(R1 >= L),
- ?line t(R1 < H),
- ?line rand_uniform_aux_test(N-1).
+ ?line t(R1 < H).
+
%%
%%