X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=modules%2Ferl%2Feuphorik_test.erl;h=b705fc62fa91b3a9dbce814557c374a954007b25;hp=3b70bf20c1db887e462cffd042776a66742a54e6;hb=7e5121be583a78ecd2cca8553717959d121df226;hpb=b7547c3be18fe564cf3e06f2a589c7cc1d78ec33 diff --git a/modules/erl/euphorik_test.erl b/modules/erl/euphorik_test.erl index 3b70bf2..b705fc6 100644 --- a/modules/erl/euphorik_test.erl +++ b/modules/erl/euphorik_test.erl @@ -52,7 +52,7 @@ creer_users(N) -> creer_users(N, []). creer_users(0, Ids) -> lists:map(fun(#user{id = Id}) -> Id end, Ids); creer_users(N, Ids) -> - creer_users(N - 1, [euphorik_bd:nouveau_user(mot_rand(random:uniform(4) + 4), "", "") | Ids ]). + creer_users(N - 1, [euphorik_bd:nouveau_user(mot_rand(random:uniform(4) + 4), "", "", #profile{}) | Ids ]). % crée un message aléatoire et le renvoie @@ -73,18 +73,18 @@ mot_rand(L, Mot) -> % Tire au hasard de 0 à 3 messages sur les 10 derniers postés, renvoie une liste de int() % répartition : -% 0 : 0.5 -% 1 : 0.3 +% 0 : 0.1 +% 1 : 0.7 % 2 : 0.15 % 3 : 0.05 messages_id_rand() -> R = random:uniform(), - if R =< 0.5 -> + if R =< 0.1 -> []; true -> Messages = lists:map(fun(#minichat{id = Id}) -> Id end, euphorik_bd:messages(8)), if - R > 0.5 andalso R =< 0.8 -> + R > 0.1 andalso R =< 0.8 -> tire_element_rand(1, Messages); R > 0.8 andalso R =< 0.95 -> tire_element_rand(2, Messages);