aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test/diameter_util.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-06-10 15:33:49 +0200
committerAnders Svensson <[email protected]>2017-06-12 16:11:53 +0200
commit9296f611de2055c65bdae9425ce80e63fba6610f (patch)
tree478206de60e05e456f4681c085a46fea2bd7e6a6 /lib/diameter/test/diameter_util.erl
parent090898729237d33b0a6968ece9f11741cde7c27b (diff)
downloadotp-9296f611de2055c65bdae9425ce80e63fba6610f.tar.gz
otp-9296f611de2055c65bdae9425ce80e63fba6610f.tar.bz2
otp-9296f611de2055c65bdae9425ce80e63fba6610f.zip
Randomly select traffic testcases
Since the number of configuration variants tested makes for (too) many. Randomly select a subset of testcases in each configuration group.
Diffstat (limited to 'lib/diameter/test/diameter_util.erl')
-rw-r--r--lib/diameter/test/diameter_util.erl13
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/diameter/test/diameter_util.erl b/lib/diameter/test/diameter_util.erl
index 81b43913de..7266d3678c 100644
--- a/lib/diameter/test/diameter_util.erl
+++ b/lib/diameter/test/diameter_util.erl
@@ -173,18 +173,7 @@ recvl([{MRef, F} | L], Ref, Fun, Acc) ->
%% Sort a list into random order.
scramble(L) ->
- foldl(fun(true, _, S, false) -> S end,
- false,
- [[fun s/1, L]]).
-
-s(L) ->
- s([], L).
-
-s(Acc, []) ->
- Acc;
-s(Acc, L) ->
- {H, [T|Rest]} = lists:split(rand:uniform(length(L)) - 1, L),
- s([T|Acc], H ++ Rest).
+ [X || {_,X} <- lists:sort([{rand:uniform(), T} || T <- L])].
%% ---------------------------------------------------------------------------
%% unique_string/0