diff options
author | Björn-Egil Dahlberg <[email protected]> | 2012-12-06 21:33:32 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2012-12-14 15:13:00 +0100 |
commit | 438382308bd34186e48d1cbee992e6e93a8fddd2 (patch) | |
tree | d6286cf1e3ebcb899770ceaf887fd0793678fa25 | |
parent | 30a65a6253a74ff6aab23142675bf2d801ba840e (diff) | |
download | otp-438382308bd34186e48d1cbee992e6e93a8fddd2.tar.gz otp-438382308bd34186e48d1cbee992e6e93a8fddd2.tar.bz2 otp-438382308bd34186e48d1cbee992e6e93a8fddd2.zip |
tests: Fix heap_sizes check
-rw-r--r-- | erts/emulator/test/beam_SUITE.erl | 17 | ||||
-rw-r--r-- | erts/emulator/test/process_SUITE.erl | 10 |
2 files changed, 17 insertions, 10 deletions
diff --git a/erts/emulator/test/beam_SUITE.erl b/erts/emulator/test/beam_SUITE.erl index 02c6e19686..60683d2634 100644 --- a/erts/emulator/test/beam_SUITE.erl +++ b/erts/emulator/test/beam_SUITE.erl @@ -215,11 +215,18 @@ heap_sizes(Config) when is_list(Config) -> (E, []) -> E end, [], Sizes), - %% Verify that the largest heap size consists of 31 or 63 bits. - ?line - case Largest bsr (erlang:system_info(wordsize)*8-2) of - R when R > 0 -> ok - end, + %% Verify that the largest heap size consists of + %% - 31 bits of bytes on 32 bits arch + %% - atleast 52 bits of bytes (48 is the maximum virtual address) + %% and at the most 63 bits on 64 bit archs + %% heap sizes are in words + case erlang:system_info(wordsize) of + 8 -> + 0 = (Largest*8) bsr 63, + true = (Largest*8) > (1 bsl 52); + 4 -> + 1 = (Largest*4) bsr 31 + end, ok. %% Thanks to Igor Goryachev. diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl index 90508a0cfa..2629bbcfdc 100644 --- a/erts/emulator/test/process_SUITE.erl +++ b/erts/emulator/test/process_SUITE.erl @@ -550,7 +550,7 @@ process_info_other_msg(Config) when is_list(Config) -> {messages,[]} = process_info(Pid, messages), {min_heap_size, 233} = process_info(Pid, min_heap_size), - {min_bin_vheap_size, 46368} = process_info(Pid, min_bin_vheap_size), + {min_bin_vheap_size, 46422} = process_info(Pid, min_bin_vheap_size), Pid ! stop, ok. @@ -1893,8 +1893,8 @@ process_flag_heap_size(doc) -> process_flag_heap_size(suite) -> []; process_flag_heap_size(Config) when is_list(Config) -> - HSize = 2584, % must be gc fib number - VHSize = 317811, % must be gc fib number + HSize = 2586, % must be gc fib+ number + VHSize = 318187, % must be gc fib+ number OldHmin = erlang:process_flag(min_heap_size, HSize), {min_heap_size, HSize} = erlang:process_info(self(), min_heap_size), OldVHmin = erlang:process_flag(min_bin_vheap_size, VHSize), @@ -1908,8 +1908,8 @@ spawn_opt_heap_size(doc) -> spawn_opt_heap_size(suite) -> []; spawn_opt_heap_size(Config) when is_list(Config) -> - HSize = 987, % must be gc fib number - VHSize = 46368, % must be gc fib number + HSize = 987, % must be gc fib+ number + VHSize = 46422, % must be gc fib+ number Pid = spawn_opt(fun () -> receive stop -> ok end end, [{min_heap_size, HSize},{ min_bin_vheap_size, VHSize}]), {min_heap_size, HSize} = process_info(Pid, min_heap_size), |