aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test/diameter_codec_test.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2016-06-11 12:42:43 +0200
committerAnders Svensson <[email protected]>2016-06-11 18:49:42 +0200
commitc980e489d02417e1144d28958fe9abd4017f72a4 (patch)
tree0074bd849cc83e3f471cb0b89feae2d611ce6bc4 /lib/diameter/test/diameter_codec_test.erl
parentf027ac4d0f1d522e3b3d5c4695baf42a5cdd5330 (diff)
downloadotp-c980e489d02417e1144d28958fe9abd4017f72a4.tar.gz
otp-c980e489d02417e1144d28958fe9abd4017f72a4.tar.bz2
otp-c980e489d02417e1144d28958fe9abd4017f72a4.zip
Use rand(3) instead of random(3)
The latter is deprecated in OTP 19.
Diffstat (limited to 'lib/diameter/test/diameter_codec_test.erl')
-rw-r--r--lib/diameter/test/diameter_codec_test.erl13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/diameter/test/diameter_codec_test.erl b/lib/diameter/test/diameter_codec_test.erl
index 78308856ac..37c41a1761 100644
--- a/lib/diameter/test/diameter_codec_test.erl
+++ b/lib/diameter/test/diameter_codec_test.erl
@@ -230,13 +230,12 @@ v(Max, Ord, E)
when Ord =< Max ->
diameter_enum:to_list(E);
v(Max, Ord, E) ->
- random:seed(diameter_util:seed()),
v(Max, Ord, E, []).
v(0, _, _, Acc) ->
Acc;
v(N, Ord, E, Acc) ->
- v(N-1, Ord, E, [E(random:uniform(Ord)) | Acc]).
+ v(N-1, Ord, E, [E(rand:uniform(Ord)) | Acc]).
%% arity/3
@@ -518,15 +517,7 @@ random(M) ->
random(0,M).
random(Mn,Mx) ->
- seed(get({?MODULE, seed})),
- Mn + random:uniform(Mx - Mn + 1) - 1.
-
-seed(undefined) ->
- put({?MODULE, seed}, true),
- random:seed(diameter_util:seed());
-
-seed(true) ->
- ok.
+ Mn + rand:uniform(Mx - Mn + 1) - 1.
%% run/1
%%