Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:18
eleveldb
eleveldb-2.0.34-test-fix-deprecated.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File eleveldb-2.0.34-test-fix-deprecated.patch of Package eleveldb
diff -Ndurp eleveldb-2.0.34/test/rand_gen_1.erl eleveldb-2.0.34-test-fix-deprecated/test/rand_gen_1.erl --- eleveldb-2.0.34/test/rand_gen_1.erl 2017-02-15 21:18:39.000000000 +0200 +++ eleveldb-2.0.34-test-fix-deprecated/test/rand_gen_1.erl 2017-08-13 19:26:55.024365341 +0300 @@ -15,9 +15,9 @@ random_bin(_Id, Size) -> HunkSize = 16*1024*1024, - BigHunk = crypto:rand_bytes(HunkSize), + BigHunk = crypto:strong_rand_bytes(HunkSize), fun() -> - Offset = random:uniform(HunkSize - Size), + Offset = rand:uniform(HunkSize - Size), <<_:Offset/binary, Bin:Size/binary, _/binary>> = BigHunk, Bin end. @@ -32,11 +32,11 @@ almost_completely_sequential(_Id, MaxSuf fun() -> {A, B, C} = os:timestamp(), TimeT = (A*1000000) + B, - End = case random:uniform(100) of + End = case rand:uniform(100) of N when N < PercentAlmostSeq -> C; % microseconds _ -> - random:uniform(MaxSuffix) + rand:uniform(MaxSuffix) end, [integer_to_list(TimeT), $_, integer_to_list(End)] @@ -54,7 +54,7 @@ almost_completely_sequential(_Id, MaxSuf %% still have the same "integer1_integer2" form, but the first integer %% will up to approximately 3 million seconds earlier than the current %% time_t wall clock time, and the second integer will be generated by -%% random:uniform(1000*1000). +%% rand:uniform(1000*1000). %% %% As MillionNotSequential approaches zero, the keys generated will %% become more and more perfectly sorted. @@ -62,11 +62,11 @@ almost_completely_sequential(_Id, MaxSuf mostly_sequential(_Id, MillionNotSequential) -> fun() -> {A, B, C} = os:timestamp(), - {X, Y, Z} = case random:uniform(1000*1000) of + {X, Y, Z} = case rand:uniform(1000*1000) of N when N < MillionNotSequential -> - {A - random:uniform(3), - abs(B - random:uniform(500*1000)), - random:uniform(1000*1000)}; + {A - rand:uniform(3), + abs(B - rand:uniform(500*1000)), + rand:uniform(1000*1000)}; _ -> {A, B, C} end, @@ -89,7 +89,7 @@ pareto(Mean, Shape) -> S1 = (-1 / Shape), S2 = Mean * (Shape - 1), fun() -> - U = 1 - random:uniform(), + U = 1 - rand:uniform(), trunc((math:pow(U, S1) - 1) * S2) end.
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor