File 1010-common_test-tests-Replace-random-with-rand.patch of Package erlang

From 38e8ab99454f69acab55e5bcb575ed60a8b72c2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Thu, 10 Dec 2015 15:10:27 +0100
Subject: [PATCH 10/15] common_test tests: Replace 'random' with 'rand'

---
 lib/common_test/test/ct_master_SUITE.erl | 2 +-
 lib/common_test/test/ct_test_support.erl | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/common_test/test/ct_master_SUITE.erl b/lib/common_test/test/ct_master_SUITE.erl
index 15b49c6..5583735 100644
--- a/lib/common_test/test/ct_master_SUITE.erl
+++ b/lib/common_test/test/ct_master_SUITE.erl
@@ -135,7 +135,7 @@ make_spec(DataDir, FileName, NodeNames, Suites, Config) ->
 
     C = lists:map(
 	  fun(NodeName) ->
-		  Rnd = random:uniform(2),
+		  Rnd = rand:uniform(2),
 		  if Rnd == 1->
 			  {config,NodeName,filename:join(DataDir,
 							 "master/config.txt")};
diff --git a/lib/common_test/test/ct_test_support.erl b/lib/common_test/test/ct_test_support.erl
index 248ec6c..4a47d34 100644
--- a/lib/common_test/test/ct_test_support.erl
+++ b/lib/common_test/test/ct_test_support.erl
@@ -414,14 +414,14 @@ ct_rpc({M,F,A}, Config) ->
 %%%-----------------------------------------------------------------
 %%% random_error/1
 random_error(Config) when is_list(Config) ->
-    random:seed(os:timestamp()),
+    rand:seed(exsplus),
     Gen = fun(0,_) -> ok; (N,Fun) -> Fun(N-1, Fun) end,
-    Gen(random:uniform(100), Gen),
+    Gen(rand:uniform(100), Gen),
 
     ErrorTypes = ['BADMATCH','BADARG','CASE_CLAUSE','FUNCTION_CLAUSE',
 		  'EXIT','THROW','UNDEF'],
-    Type = lists:nth(random:uniform(length(ErrorTypes)), ErrorTypes),
-    Where = case random:uniform(2) of
+    Type = lists:nth(rand:uniform(length(ErrorTypes)), ErrorTypes),
+    Where = case rand:uniform(2) of
 		1 ->
 		    io:format("ct_test_support *returning* error of type ~w",
 			      [Type]),
-- 
2.1.4

openSUSE Build Service is sponsored by