aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorGuilherme Andrade <[email protected]>2017-04-24 22:51:49 +0100
committerGuilherme Andrade <[email protected]>2017-04-24 22:51:49 +0100
commit3d6b8e7fb68543713f1620a45b8a590ef4ed88a5 (patch)
tree19aa3c6c0d405bd498671708886919730e5d69c9 /erts/emulator/test
parentda9abd24a93ae8fe174cdd38fc9699bbc45fdf56 (diff)
downloadotp-3d6b8e7fb68543713f1620a45b8a590ef4ed88a5.tar.gz
otp-3d6b8e7fb68543713f1620a45b8a590ef4ed88a5.tar.bz2
otp-3d6b8e7fb68543713f1620a45b8a590ef4ed88a5.zip
erts: Discontinue salted use of enif_hash/phash2
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/nif_SUITE.erl13
1 files changed, 4 insertions, 9 deletions
diff --git a/erts/emulator/test/nif_SUITE.erl b/erts/emulator/test/nif_SUITE.erl
index 6e4866bfd8..8ad11d3bf3 100644
--- a/erts/emulator/test/nif_SUITE.erl
+++ b/erts/emulator/test/nif_SUITE.erl
@@ -59,8 +59,7 @@
nif_snprintf/1,
nif_internal_hash/1,
nif_internal_hash_salted/1,
- nif_phash2/1,
- nif_phash2_salted/1
+ nif_phash2/1
]).
-export([many_args_100/100]).
@@ -97,8 +96,7 @@ all() ->
nif_snprintf,
nif_internal_hash,
nif_internal_hash_salted,
- nif_phash2,
- nif_phash2_salted].
+ nif_phash2].
groups() ->
[{G, [], api_repeaters()} || G <- api_groups()]
@@ -2637,7 +2635,8 @@ nif_phash2(Config) ->
lists:map(
fun (Term) ->
HashValue = erlang:phash2(Term),
- NifHashValue = hash_nif(phash2, Term, 0),
+ Salt = random_uint32(), % phash2 should ignore salt
+ NifHashValue = hash_nif(phash2, Term, Salt),
(HashValue =:= NifHashValue
orelse ct:fail("Expected: ~p\nActual: ~p",
[HashValue, NifHashValue])),
@@ -2646,10 +2645,6 @@ nif_phash2(Config) ->
Terms),
test_bit_distribution_fitness(HashValues, HashValueBitSize, 0.05).
-nif_phash2_salted(Config) ->
- ensure_lib_loaded(Config),
- test_salted_nif_hash(phash2).
-
test_salted_nif_hash(HashType) ->
HashValueBitSize = nif_hash_result_bitsize(HashType),
Terms = unique([random_term() || _ <- lists:seq(1, 5000)]),