aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2019-02-11 14:39:29 +0100
committerSverker Eriksson <[email protected]>2019-02-11 14:39:29 +0100
commit0a72d1714f7d7f447a78433451c39c75da6ae103 (patch)
treefaa36fce39c50fdd358ee5c4d87b306ef5312d93 /erts/emulator/test
parentb34fc22d8b336b9b5a3d02d30ea22e16f3f1ddce (diff)
parent2e36105479b300a6c51e21b31e03ded39df8c02b (diff)
downloadotp-0a72d1714f7d7f447a78433451c39c75da6ae103.tar.gz
otp-0a72d1714f7d7f447a78433451c39c75da6ae103.tar.bz2
otp-0a72d1714f7d7f447a78433451c39c75da6ae103.zip
Merge branch 'sverker/map-from-ks-vs-bug/OTP-15567' into maint
* sverker/map-from-ks-vs-bug/OTP-15567: erts: Add test for bug in enif_make_maps_from_arrays erts: Fix bug in erts_map_from_ks_and_vs
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/nif_SUITE.erl16
1 files changed, 16 insertions, 0 deletions
diff --git a/erts/emulator/test/nif_SUITE.erl b/erts/emulator/test/nif_SUITE.erl
index a2f3489943..ca5f90621f 100644
--- a/erts/emulator/test/nif_SUITE.erl
+++ b/erts/emulator/test/nif_SUITE.erl
@@ -1175,6 +1175,15 @@ maps(Config) when is_list(Config) ->
M2 = maps_from_list_nif(maps:to_list(M2)),
M3 = maps_from_list_nif(maps:to_list(M3)),
+ %% Test different map sizes (OTP-15567)
+ repeat_while(fun({35,_}) -> false;
+ ({K,Map}) ->
+ Map = maps_from_list_nif(maps:to_list(Map)),
+ Map = maps:filter(fun(K,V) -> V =:= K*100 end, Map),
+ {K+1, maps:put(K,K*100,Map)}
+ end,
+ {1,#{}}),
+
has_duplicate_keys = maps_from_list_nif([{1,1},{1,1}]),
verify_tmpmem(TmpMem),
@@ -2471,6 +2480,13 @@ repeat(0, _, Arg) ->
repeat(N, Fun, Arg0) ->
repeat(N-1, Fun, Fun(Arg0)).
+repeat_while(Fun, Acc0) ->
+ case Fun(Acc0) of
+ false -> ok;
+ Acc1 ->
+ repeat_while(Fun, Acc1)
+ end.
+
check(Exp,Got,Line) ->
case Got of
Exp -> Exp;