aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2016-04-12 14:30:02 +0200
committerRaimo Niskanen <[email protected]>2016-04-12 14:30:32 +0200
commit9db6054d674969fef314bf8676b6f9b583af3bef (patch)
tree3dbd72061da3fedb418ab714c13fe767dcd843a8 /lib/stdlib/test
parent6bf2768c6836440634019d69231534ed69fcf982 (diff)
downloadotp-9db6054d674969fef314bf8676b6f9b583af3bef.tar.gz
otp-9db6054d674969fef314bf8676b6f9b583af3bef.tar.bz2
otp-9db6054d674969fef314bf8676b6f9b583af3bef.zip
Fix missing short forms for event timeout
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/gen_statem_SUITE.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/stdlib/test/gen_statem_SUITE.erl b/lib/stdlib/test/gen_statem_SUITE.erl
index 573a64bbb7..27fb7d9650 100644
--- a/lib/stdlib/test/gen_statem_SUITE.erl
+++ b/lib/stdlib/test/gen_statem_SUITE.erl
@@ -1305,10 +1305,10 @@ terminate(_Reason, _State, _Data) ->
idle(cast, {connect,Pid}, Data) ->
Pid ! accept,
- {next_state,wfor_conf,Data};
+ {next_state,wfor_conf,Data,infinity}; % NoOp timeout just to test API
idle({call,From}, connect, Data) ->
gen_statem:reply(From, accept),
- {next_state,wfor_conf,Data};
+ {next_state,wfor_conf,Data,infinity}; % NoOp timeout just to test API
idle(cast, badreturn, _Data) ->
badreturn;
idle({call,_From}, badreturn, _Data) ->
@@ -1343,13 +1343,15 @@ idle(Type, Content, Data) ->
timeout(timeout, idle, {From,Time}) ->
TRef = erlang:start_timer(Time, self(), ok),
+ {keep_state,{From,TRef},0}; % Immediate timeout 0
+timeout(timeout, 0, {From,TRef}) ->
{next_state,timeout2,{From,TRef},
[{timeout,1,should_be_cancelled},
postpone]}; % Should cancel state timeout
timeout(_, _, _) ->
keep_state_and_data.
-timeout2(timeout, idle, _) ->
+timeout2(timeout, 0, _) ->
keep_state_and_data;
timeout2(timeout, Reason, _) ->
{stop,Reason};