diff options
author | Raimo Niskanen <[email protected]> | 2012-03-22 14:29:55 +0100 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2012-03-22 15:41:18 +0100 |
commit | f67487b67bfb9ab04b01ef87bbfc39a24f604f11 (patch) | |
tree | 3029c7a42a621670cdf4834a3712bca2f9376b9d /erts/emulator/test | |
parent | 5d7ed57d07118f95cf970ee655ea8eea76cbe6fd (diff) | |
parent | 1e13b92d5c6543c82219610aa1336dbdf1f4dc2d (diff) | |
download | otp-f67487b67bfb9ab04b01ef87bbfc39a24f604f11.tar.gz otp-f67487b67bfb9ab04b01ef87bbfc39a24f604f11.tar.bz2 otp-f67487b67bfb9ab04b01ef87bbfc39a24f604f11.zip |
Merge branch 'maint'
Conflicts:
erts/doc/src/erlang.xml
erts/emulator/beam/erl_process.c
erts/emulator/beam/erl_process.h
erts/emulator/test/bif_SUITE.erl
erts/preloaded/ebin/erlang.beam
erts/preloaded/src/erlang.erl
lib/hipe/cerl/erl_bif_types.erl
Diffstat (limited to 'erts/emulator/test')
-rw-r--r-- | erts/emulator/test/bif_SUITE.erl | 56 |
1 files changed, 53 insertions, 3 deletions
diff --git a/erts/emulator/test/bif_SUITE.erl b/erts/emulator/test/bif_SUITE.erl index 90c89cc12b..ebbd8b31c6 100644 --- a/erts/emulator/test/bif_SUITE.erl +++ b/erts/emulator/test/bif_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2011. All Rights Reserved. +%% Copyright Ericsson AB 2005-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -30,7 +30,7 @@ specs/1,improper_bif_stubs/1,auto_imports/1, t_list_to_existing_atom/1,os_env/1,otp_7526/1, binary_to_atom/1,binary_to_existing_atom/1, - atom_to_binary/1,min_max/1]). + atom_to_binary/1,min_max/1, erlang_halt/1]). suite() -> [{ct_hooks,[ts_install_cth]}]. @@ -40,7 +40,7 @@ all() -> t_list_to_existing_atom, os_env, otp_7526, display, atom_to_binary, binary_to_atom, binary_to_existing_atom, - min_max]. + min_max, erlang_halt]. groups() -> []. @@ -640,6 +640,47 @@ min_max(Config) when is_list(Config) -> ok. + + +erlang_halt(Config) when is_list(Config) -> + try erlang:halt(undefined) of + _-> ?t:fail({erlang,halt,{undefined}}) + catch error:badarg -> ok end, + try halt(undefined) of + _-> ?t:fail({halt,{undefined}}) + catch error:badarg -> ok end, + try erlang:halt(undefined, []) of + _-> ?t:fail({erlang,halt,{undefined,[]}}) + catch error:badarg -> ok end, + try halt(undefined, []) of + _-> ?t:fail({halt,{undefined,[]}}) + catch error:badarg -> ok end, + try halt(0, undefined) of + _-> ?t:fail({halt,{0,undefined}}) + catch error:badarg -> ok end, + try halt(0, [undefined]) of + _-> ?t:fail({halt,{0,[undefined]}}) + catch error:badarg -> ok end, + try halt(0, [{undefined,true}]) of + _-> ?t:fail({halt,{0,[{undefined,true}]}}) + catch error:badarg -> ok end, + try halt(0, [{flush,undefined}]) of + _-> ?t:fail({halt,{0,[{flush,undefined}]}}) + catch error:badarg -> ok end, + try halt(0, [{flush,true,undefined}]) of + _-> ?t:fail({halt,{0,[{flush,true,undefined}]}}) + catch error:badarg -> ok end, + H = hostname(), + {ok,N1} = slave:start(H, halt_node1), + {badrpc,nodedown} = rpc:call(N1, erlang, halt, []), + {ok,N2} = slave:start(H, halt_node2), + {badrpc,nodedown} = rpc:call(N2, erlang, halt, [0]), + {ok,N3} = slave:start(H, halt_node3), + {badrpc,nodedown} = rpc:call(N3, erlang, halt, [0,[]]), + ok. + + + %% Helpers id(I) -> I. @@ -671,3 +712,12 @@ extract_abstract(Mod, Path) -> {ok,{Mod,[{abstract_code,{raw_abstract_v1,Abstr}}]}} = beam_lib:chunks(Beam, [abstract_code]), {Mod,Abstr}. + + +hostname() -> + hostname(atom_to_list(node())). + +hostname([$@ | Hostname]) -> + list_to_atom(Hostname); +hostname([_C | Cs]) -> + hostname(Cs). |