diff options
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r-- | lib/stdlib/test/gen_event_SUITE.erl | 38 | ||||
-rw-r--r-- | lib/stdlib/test/gen_fsm_SUITE.erl | 34 | ||||
-rw-r--r-- | lib/stdlib/test/gen_server_SUITE.erl | 32 |
3 files changed, 52 insertions, 52 deletions
diff --git a/lib/stdlib/test/gen_event_SUITE.erl b/lib/stdlib/test/gen_event_SUITE.erl index 1594049ebf..6be5a299b6 100644 --- a/lib/stdlib/test/gen_event_SUITE.erl +++ b/lib/stdlib/test/gen_event_SUITE.erl @@ -963,18 +963,18 @@ get_state(suite) -> get_state(doc) -> ["Test that sys:get_state/1,2 return the gen_event state"]; get_state(Config) when is_list(Config) -> - ?line {ok, Pid} = gen_event:start({local, my_dummy_handler}), + {ok, Pid} = gen_event:start({local, my_dummy_handler}), State1 = self(), - ?line ok = gen_event:add_handler(my_dummy_handler, dummy1_h, [State1]), - ?line [{dummy1_h,false,State1}] = sys:get_state(Pid), - ?line [{dummy1_h,false,State1}] = sys:get_state(Pid, 5000), + ok = gen_event:add_handler(my_dummy_handler, dummy1_h, [State1]), + [{dummy1_h,false,State1}] = sys:get_state(Pid), + [{dummy1_h,false,State1}] = sys:get_state(Pid, 5000), State2 = {?MODULE, self()}, - ?line ok = gen_event:add_handler(my_dummy_handler, {dummy1_h,id}, [State2]), - ?line Result1 = sys:get_state(Pid), - ?line [{dummy1_h,false,State1},{dummy1_h,id,State2}] = lists:sort(Result1), - ?line Result2 = sys:get_state(Pid, 5000), - ?line [{dummy1_h,false,State1},{dummy1_h,id,State2}] = lists:sort(Result2), - ?line ok = gen_event:stop(Pid), + ok = gen_event:add_handler(my_dummy_handler, {dummy1_h,id}, [State2]), + Result1 = sys:get_state(Pid), + [{dummy1_h,false,State1},{dummy1_h,id,State2}] = lists:sort(Result1), + Result2 = sys:get_state(Pid, 5000), + [{dummy1_h,false,State1},{dummy1_h,id,State2}] = lists:sort(Result2), + ok = gen_event:stop(Pid), ok. replace_state(suite) -> @@ -982,20 +982,20 @@ replace_state(suite) -> replace_state(doc) -> ["Test that replace_state/2,3 replace the gen_event state"]; replace_state(Config) when is_list(Config) -> - ?line {ok, Pid} = gen_event:start({local, my_dummy_handler}), + {ok, Pid} = gen_event:start({local, my_dummy_handler}), State1 = self(), - ?line ok = gen_event:add_handler(my_dummy_handler, dummy1_h, [State1]), - ?line [{dummy1_h,false,State1}] = sys:get_state(Pid), + ok = gen_event:add_handler(my_dummy_handler, dummy1_h, [State1]), + [{dummy1_h,false,State1}] = sys:get_state(Pid), NState1 = "replaced", Replace1 = fun({dummy1_h,false,_}=S) -> setelement(3,S,NState1) end, - ?line [{dummy1_h,false,NState1}] = sys:replace_state(Pid, Replace1), - ?line [{dummy1_h,false,NState1}] = sys:get_state(Pid), + [{dummy1_h,false,NState1}] = sys:replace_state(Pid, Replace1), + [{dummy1_h,false,NState1}] = sys:get_state(Pid), NState2 = "replaced again", Replace2 = fun({dummy1_h,false,_}=S) -> setelement(3,S,NState2) end, - ?line [{dummy1_h,false,NState2}] = sys:replace_state(Pid, Replace2, 5000), - ?line [{dummy1_h,false,NState2}] = sys:get_state(Pid), + [{dummy1_h,false,NState2}] = sys:replace_state(Pid, Replace2, 5000), + [{dummy1_h,false,NState2}] = sys:get_state(Pid), %% verify no change in state if replace function crashes Replace3 = fun(_) -> exit(fail) end, - ?line [{dummy1_h,false,NState2}] = sys:replace_state(Pid, Replace3), - ?line [{dummy1_h,false,NState2}] = sys:get_state(Pid), + [{dummy1_h,false,NState2}] = sys:replace_state(Pid, Replace3), + [{dummy1_h,false,NState2}] = sys:get_state(Pid), ok. diff --git a/lib/stdlib/test/gen_fsm_SUITE.erl b/lib/stdlib/test/gen_fsm_SUITE.erl index f6b0fbc20d..fd15838b7d 100644 --- a/lib/stdlib/test/gen_fsm_SUITE.erl +++ b/lib/stdlib/test/gen_fsm_SUITE.erl @@ -415,36 +415,36 @@ error_format_status(Config) when is_list(Config) -> get_state(Config) when is_list(Config) -> State = self(), - ?line {ok, Pid} = gen_fsm:start(?MODULE, {state_data, State}, []), - ?line {idle, State} = sys:get_state(Pid), - ?line {idle, State} = sys:get_state(Pid, 5000), - ?line stop_it(Pid), + {ok, Pid} = gen_fsm:start(?MODULE, {state_data, State}, []), + {idle, State} = sys:get_state(Pid), + {idle, State} = sys:get_state(Pid, 5000), + stop_it(Pid), %% check that get_state can handle a name being an atom (pid is %% already checked by the previous test) - ?line {ok, Pid2} = gen_fsm:start({local, gfsm}, gen_fsm_SUITE, {state_data, State}, []), - ?line {idle, State} = sys:get_state(gfsm), - ?line {idle, State} = sys:get_state(gfsm, 5000), - ?line stop_it(Pid2), + {ok, Pid2} = gen_fsm:start({local, gfsm}, gen_fsm_SUITE, {state_data, State}, []), + {idle, State} = sys:get_state(gfsm), + {idle, State} = sys:get_state(gfsm, 5000), + stop_it(Pid2), ok. replace_state(Config) when is_list(Config) -> State = self(), - ?line {ok, Pid} = gen_fsm:start(?MODULE, {state_data, State}, []), - ?line {idle, State} = sys:get_state(Pid), + {ok, Pid} = gen_fsm:start(?MODULE, {state_data, State}, []), + {idle, State} = sys:get_state(Pid), NState1 = "replaced", Replace1 = fun({StateName, _}) -> {StateName, NState1} end, - ?line {idle, NState1} = sys:replace_state(Pid, Replace1), - ?line {idle, NState1} = sys:get_state(Pid), + {idle, NState1} = sys:replace_state(Pid, Replace1), + {idle, NState1} = sys:get_state(Pid), NState2 = "replaced again", Replace2 = fun({idle, _}) -> {state0, NState2} end, - ?line {state0, NState2} = sys:replace_state(Pid, Replace2, 5000), - ?line {state0, NState2} = sys:get_state(Pid), + {state0, NState2} = sys:replace_state(Pid, Replace2, 5000), + {state0, NState2} = sys:get_state(Pid), %% verify no change in state if replace function crashes Replace3 = fun(_) -> error(fail) end, - ?line {state0, NState2} = sys:replace_state(Pid, Replace3), - ?line {state0, NState2} = sys:get_state(Pid), - ?line stop_it(Pid), + {state0, NState2} = sys:replace_state(Pid, Replace3), + {state0, NState2} = sys:get_state(Pid), + stop_it(Pid), ok. %% Hibernation diff --git a/lib/stdlib/test/gen_server_SUITE.erl b/lib/stdlib/test/gen_server_SUITE.erl index a5cba6e4c4..3b6a3f38bc 100644 --- a/lib/stdlib/test/gen_server_SUITE.erl +++ b/lib/stdlib/test/gen_server_SUITE.erl @@ -1042,13 +1042,13 @@ get_state(doc) -> ["Test that sys:get_state/1,2 return the gen_server state"]; get_state(Config) when is_list(Config) -> State = self(), - ?line {ok, _Pid} = gen_server:start_link({local, get_state}, + {ok, _Pid} = gen_server:start_link({local, get_state}, ?MODULE, {state,State}, []), - ?line State = sys:get_state(get_state), - ?line State = sys:get_state(get_state, 5000), - ?line {ok, Pid} = gen_server:start_link(?MODULE, {state,State}, []), - ?line State = sys:get_state(Pid), - ?line State = sys:get_state(Pid, 5000), + State = sys:get_state(get_state), + State = sys:get_state(get_state, 5000), + {ok, Pid} = gen_server:start_link(?MODULE, {state,State}, []), + State = sys:get_state(Pid), + State = sys:get_state(Pid, 5000), ok. %% Verify that sys:replace_state correctly replaces gen_server state @@ -1059,24 +1059,24 @@ replace_state(doc) -> ["Test that sys:replace_state/1,2 replace the gen_server state"]; replace_state(Config) when is_list(Config) -> State = self(), - ?line {ok, _Pid} = gen_server:start_link({local, replace_state}, + {ok, _Pid} = gen_server:start_link({local, replace_state}, ?MODULE, {state,State}, []), - ?line State = sys:get_state(replace_state), + State = sys:get_state(replace_state), NState1 = "replaced", Replace1 = fun(_) -> NState1 end, - ?line NState1 = sys:replace_state(replace_state, Replace1), - ?line NState1 = sys:get_state(replace_state), - ?line {ok, Pid} = gen_server:start_link(?MODULE, {state,NState1}, []), - ?line NState1 = sys:get_state(Pid), + NState1 = sys:replace_state(replace_state, Replace1), + NState1 = sys:get_state(replace_state), + {ok, Pid} = gen_server:start_link(?MODULE, {state,NState1}, []), + NState1 = sys:get_state(Pid), Suffix = " again", NState2 = NState1 ++ Suffix, Replace2 = fun(S) -> S ++ Suffix end, - ?line NState2 = sys:replace_state(Pid, Replace2, 5000), - ?line NState2 = sys:get_state(Pid, 5000), + NState2 = sys:replace_state(Pid, Replace2, 5000), + NState2 = sys:get_state(Pid, 5000), %% verify no change in state if replace function crashes Replace3 = fun(_) -> throw(fail) end, - ?line NState2 = sys:replace_state(Pid, Replace3), - ?line NState2 = sys:get_state(Pid, 5000), + NState2 = sys:replace_state(Pid, Replace3), + NState2 = sys:get_state(Pid, 5000), ok. %% Test that the time for a huge message queue is not |