30
30
call_remote_n1/1, call_remote_n2/1, call_remote_n3/1, spec_init/1,
31
31
spec_init_local_registered_parent/1,
32
32
spec_init_global_registered_parent/1,
33
otp_5854/1, hibernate/1, otp_7669/1
33
otp_5854/1, hibernate/1, otp_7669/1, call_format_status/1
43
43
% The gen_server behaviour
44
44
-export([init/1, handle_call/3, handle_cast/2,
45
handle_info/2, terminate/2]).
45
handle_info/2, terminate/2, format_status/2]).
48
48
[start, crash, call, cast, cast_fast, info,
51
51
call_remote_n2, call_remote_n3, spec_init,
52
52
spec_init_local_registered_parent,
53
53
spec_init_global_registered_parent,
54
otp_5854,hibernate,otp_7669].
54
otp_5854, hibernate, otp_7669, call_format_status].
56
56
-define(default_timeout, ?t:minutes(1)).
853
853
%% If initialization fails (with ignore or {stop,Reason}),
854
%% make sure that the process is not registered when gen_sever:start()
854
%% make sure that the process is not registered when gen_server:start()
857
857
otp_7669(Config) when is_list(Config) ->
887
887
?MODULE, stop, []),
888
888
?line undefined = global:whereis_name(?MODULE).
890
%% Verify that sys:get_status correctly calls our format_status/2 fun
892
call_format_status(suite) ->
894
call_format_status(doc) ->
895
["Test that sys:get_status/1,2 calls format_status/2"];
896
call_format_status(Config) when is_list(Config) ->
897
?line {ok, Pid} = gen_server:start_link({local, call_format_status},
898
gen_server_SUITE, [], []),
899
?line Status1 = sys:get_status(call_format_status),
900
?line {status, Pid, _Mod, [_PDict, running, _Parent, _, Data1]} = Status1,
901
?line [format_status_called | _] = lists:reverse(Data1),
902
?line Status2 = sys:get_status(call_format_status, 5000),
903
?line {status, Pid, _Mod, [_PDict, running, _Parent, _, Data2]} = Status2,
904
?line [format_status_called | _] = lists:reverse(Data2),
890
908
%%--------------------------------------------------------------
891
909
%% Help functions to spec_init_*
892
910
start_link(Init, Options) ->