aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/bs_construct_SUITE.erl
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2016-06-14 10:22:40 +0200
committerLukas Larsson <[email protected]>2016-06-14 10:22:40 +0200
commit1418cbbb689dc2c88ecceaedb4eba33061d338e7 (patch)
tree348257a01f32af0ceb349933c4a7dbe64c884df7 /erts/emulator/test/bs_construct_SUITE.erl
parent0c8357d15dd2573331056a308e3744927ce406ad (diff)
parent9411a2098d983cac05fd7198bba26b9d56aa484a (diff)
downloadotp-1418cbbb689dc2c88ecceaedb4eba33061d338e7.tar.gz
otp-1418cbbb689dc2c88ecceaedb4eba33061d338e7.tar.bz2
otp-1418cbbb689dc2c88ecceaedb4eba33061d338e7.zip
Merge branch 'lukas/erts/testfixes-19'
* lukas/erts/testfixes-19: erts: Increase bif and nif call_time trace test erts: Fix distribution_SUITE:bulk_send_bigbig on windows erts: Ensure bs_add_overflow test has enough memory kernel: Better explain controlling_process' tcp behaviour kernel: Fix t_recv_delim on bsd os_mon: Make sure to start/stop os_mon in tests correctly ssl: Fix use_interface dist_SSL test erl_interface: Fix signed int overflow tc bug erts: fix atom_roundtrip_r15b tc erts: Require more memory for debug tests
Diffstat (limited to 'erts/emulator/test/bs_construct_SUITE.erl')
-rw-r--r--erts/emulator/test/bs_construct_SUITE.erl20
1 files changed, 18 insertions, 2 deletions
diff --git a/erts/emulator/test/bs_construct_SUITE.erl b/erts/emulator/test/bs_construct_SUITE.erl
index 22a1c0b765..95042ac802 100644
--- a/erts/emulator/test/bs_construct_SUITE.erl
+++ b/erts/emulator/test/bs_construct_SUITE.erl
@@ -23,6 +23,7 @@
-module(bs_construct_SUITE).
-export([all/0, suite/0,
+ init_per_suite/1, end_per_suite/1,
test1/1, test2/1, test3/1, test4/1, test5/1, testf/1,
not_used/1, in_guard/1,
mem_leak/1, coerce_to_float/1, bjorn/1,
@@ -43,6 +44,12 @@ all() ->
copy_writable_binary, kostis, dynamic, bs_add, otp_7422, zero_width,
bad_append, bs_add_overflow].
+init_per_suite(Config) ->
+ Config.
+
+end_per_suite(_Config) ->
+ application:stop(os_mon).
+
big(1) ->
57285702734876389752897683.
@@ -882,10 +889,14 @@ append_unit_16(Bin) ->
%% Produce a large result of bs_add that, if cast to signed int, would overflow
%% into a negative number that fits a smallnum.
-bs_add_overflow(Config) ->
+bs_add_overflow(_Config) ->
+ Memsize = memsize(),
+ io:format("Memsize = ~w Bytes~n", [Memsize]),
case erlang:system_info(wordsize) of
8 ->
{skip, "64-bit architecture"};
+ _ when Memsize < (2 bsl 30) ->
+ {skip, "Less then 2 GB of memory"};
4 ->
Large = <<0:((1 bsl 30)-1)>>,
{'EXIT',{system_limit,_}} =
@@ -894,5 +905,10 @@ bs_add_overflow(Config) ->
Large/bits>>),
ok
end.
-
+
id(I) -> I.
+
+memsize() ->
+ application:ensure_all_started(os_mon),
+ {Tot,_Used,_} = memsup:get_memory_data(),
+ Tot.