aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-12-17 08:43:12 +0100
committerBjörn Gustavsson <[email protected]>2015-12-17 08:46:01 +0100
commitcf04a89bb3585466896e6eef61bfd6e8aed27527 (patch)
treec1fd0199eee0403aaaeff82485da1823cc1ad984 /lib
parent0e35294cfc820828295a65511c5e4a62e03a6452 (diff)
downloadotp-cf04a89bb3585466896e6eef61bfd6e8aed27527.tar.gz
otp-cf04a89bb3585466896e6eef61bfd6e8aed27527.tar.bz2
otp-cf04a89bb3585466896e6eef61bfd6e8aed27527.zip
test_server tests: Update test cases to cope with use of 'rand'
In 80757f9, test_server was updated use the new 'rand' module instead of 'random', but the the shuffle test cases were not updated.
Diffstat (limited to 'lib')
-rw-r--r--lib/test_server/test/test_server_SUITE_data/test_server_shuffle01_SUITE.erl19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/test_server/test/test_server_SUITE_data/test_server_shuffle01_SUITE.erl b/lib/test_server/test/test_server_SUITE_data/test_server_shuffle01_SUITE.erl
index 847c7b6bdd..80ac9f6b3d 100644
--- a/lib/test_server/test/test_server_SUITE_data/test_server_shuffle01_SUITE.erl
+++ b/lib/test_server/test/test_server_SUITE_data/test_server_shuffle01_SUITE.erl
@@ -224,7 +224,7 @@ conf5_end(_Config) ->
ok.
conf6_init(Config) when is_list(Config) ->
- [{shuffle,{_,_,_}}] = ?config(tc_group_properties,Config),
+ validate_shuffle(Config),
test_server:comment("Shuffle (random)"),
init = ?config(suite,Config),
[{cc6,conf6}|Config].
@@ -242,23 +242,28 @@ conf5(suite) -> % test specification
conf7_init(Config) when is_list(Config) ->
test_server:comment("Group 7, Shuffle (random seed)"),
- case proplists:get_value(shuffle,?config(tc_group_properties,Config)) of
- {_,_,_} -> ok
- end,
+ validate_shuffle(Config),
[{cc7,conf7}|Config].
conf7_end(_Config) ->
ok.
conf8_init(Config) when is_list(Config) ->
test_server:comment("Group 8, Shuffle (user start seed)"),
- case proplists:get_value(shuffle,?config(tc_group_properties,Config)) of
- {_,_,_} -> ok
- end,
+ validate_shuffle(Config),
init = ?config(suite,Config),
[{cc8,conf8}|Config].
conf8_end(_Config) ->
ok.
+validate_shuffle(Config) ->
+ case proplists:get_value(shuffle, ?config(tc_group_properties,Config)) of
+ {_,_,_} ->
+ ok;
+ Seed ->
+ %% Must be a valid seed.
+ _ = rand:seed_s(rand:export_seed_s(Seed))
+ end.
+
%%---------- test cases ----------