aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2016-03-01 08:31:58 +0100
committerRaimo Niskanen <[email protected]>2016-03-02 08:21:56 +0100
commit9dfb4e6cf574870ac6e6a5a2a507c989c64e7525 (patch)
tree04fca4bcdfefa8ea4b960b07b324f266baba600d /lib/stdlib/test
parenta0c69303c971b4c65e5cd450dbe7de680aa58181 (diff)
downloadotp-9dfb4e6cf574870ac6e6a5a2a507c989c64e7525.tar.gz
otp-9dfb4e6cf574870ac6e6a5a2a507c989c64e7525.tar.bz2
otp-9dfb4e6cf574870ac6e6a5a2a507c989c64e7525.zip
Change code_change/4 to {ok,State,Data}
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/gen_statem_SUITE.erl15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/stdlib/test/gen_statem_SUITE.erl b/lib/stdlib/test/gen_statem_SUITE.erl
index f605f0c7b9..573a64bbb7 100644
--- a/lib/stdlib/test/gen_statem_SUITE.erl
+++ b/lib/stdlib/test/gen_statem_SUITE.erl
@@ -55,7 +55,7 @@ groups() ->
{abnormal, [], [abnormal1, abnormal2]},
{abnormal_handle_event, [], [abnormal1, abnormal2]},
{sys, [],
- [sys1,
+ [sys1, code_change,
call_format_status,
error_format_status, terminate_crash_format,
get_state, replace_state]},
@@ -633,6 +633,15 @@ sys1(Config) ->
sys:resume(Pid),
stop_it(Pid).
+code_change(Config) ->
+ {ok,Pid} = gen_statem:start(?MODULE, start_arg(Config, []), []),
+ {idle,data} = sys:get_state(Pid),
+ sys:suspend(Pid),
+ sys:change_code(Pid, ?MODULE, old_vsn, extra),
+ sys:resume(Pid),
+ {idle,{old_vsn,data,extra}} = sys:get_state(Pid),
+ stop_it(Pid).
+
call_format_status(Config) ->
{ok,Pid} = gen_statem:start(?MODULE, start_arg(Config, []), []),
Status = sys:get_status(Pid),
@@ -1550,8 +1559,8 @@ wrap_result(Result) ->
-code_change(_OldVsn, State, Data, _Extra) ->
- {ok,State,Data}.
+code_change(OldVsn, State, Data, Extra) ->
+ {ok,State,{OldVsn,Data,Extra}}.
format_status(terminate, [_Pdict,State,Data]) ->
{formatted,State,Data};