diff options
author | Björn Gustavsson <[email protected]> | 2015-12-18 12:10:22 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-12-18 12:10:22 +0100 |
commit | e6a733c5a903fafb52b73f7813fed72e4e29be6c (patch) | |
tree | 3cbaa174fd46bde94c4f0ea6066a001101e2fccc /lib | |
parent | a1127bd7c97a6460b298e2efc6742514bb894259 (diff) | |
parent | cf04a89bb3585466896e6eef61bfd6e8aed27527 (diff) | |
download | otp-e6a733c5a903fafb52b73f7813fed72e4e29be6c.tar.gz otp-e6a733c5a903fafb52b73f7813fed72e4e29be6c.tar.bz2 otp-e6a733c5a903fafb52b73f7813fed72e4e29be6c.zip |
Merge branch 'bjorn/deprecate-random/OTP-12502'
* bjorn/deprecate-random/OTP-12502:
test_server tests: Update test cases to cope with use of 'rand'
Diffstat (limited to 'lib')
-rw-r--r-- | lib/test_server/test/test_server_SUITE_data/test_server_shuffle01_SUITE.erl | 19 |
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 ---------- |