diff options
author | Siri Hansen <[email protected]> | 2014-03-25 09:46:49 +0100 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2014-03-25 09:47:19 +0100 |
commit | aa2dfd7c30d3ca3318498bcbf4155dad175b6d7e (patch) | |
tree | 3b7d38226fe79cc2b19162313e0eac8a44b697f0 /lib/stdlib/test/gen_event_SUITE.erl | |
parent | 1eee4ded1b435d3728fc75ad384626c80025bb3b (diff) | |
parent | cbcac6f0d55907dda2e0c385eba44eac2e7923d2 (diff) | |
download | otp-aa2dfd7c30d3ca3318498bcbf4155dad175b6d7e.tar.gz otp-aa2dfd7c30d3ca3318498bcbf4155dad175b6d7e.tar.bz2 otp-aa2dfd7c30d3ca3318498bcbf4155dad175b6d7e.zip |
Merge branch 'vinoski/sys-get-rep-state2'
* vinoski/sys-get-rep-state2:
remove tuple funs from special process documentation
fix sys:get_state/1,2 and sys:replace_state/2,3 when sys suspended
OTP-11817
Diffstat (limited to 'lib/stdlib/test/gen_event_SUITE.erl')
-rw-r--r-- | lib/stdlib/test/gen_event_SUITE.erl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/stdlib/test/gen_event_SUITE.erl b/lib/stdlib/test/gen_event_SUITE.erl index 5819ef3890..60a1ba8c60 100644 --- a/lib/stdlib/test/gen_event_SUITE.erl +++ b/lib/stdlib/test/gen_event_SUITE.erl @@ -974,6 +974,10 @@ get_state(Config) when is_list(Config) -> [{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 = sys:suspend(Pid), + Result3 = sys:get_state(Pid), + [{dummy1_h,false,State1},{dummy1_h,id,State2}] = lists:sort(Result3), + ok = sys:resume(Pid), ok = gen_event:stop(Pid), ok. @@ -998,4 +1002,11 @@ replace_state(Config) when is_list(Config) -> Replace3 = fun(_) -> exit(fail) end, [{dummy1_h,false,NState2}] = sys:replace_state(Pid, Replace3), [{dummy1_h,false,NState2}] = sys:get_state(Pid), + %% verify state replaced if process sys suspended + NState3 = "replaced again and again", + Replace4 = fun({dummy1_h,false,_}=S) -> setelement(3,S,NState3) end, + ok = sys:suspend(Pid), + [{dummy1_h,false,NState3}] = sys:replace_state(Pid, Replace4), + ok = sys:resume(Pid), + [{dummy1_h,false,NState3}] = sys:get_state(Pid), ok. |