aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test/dummy_h.erl
diff options
context:
space:
mode:
authorZandra Norman <[email protected]>2017-01-23 16:07:52 +0100
committerZandra Norman <[email protected]>2017-04-21 15:02:49 +0200
commitdb632b91f41c4a01be68d821d6942ff32b86e40b (patch)
treebc9d2e109735a34b3f9b18942f0a18df7aed2210 /lib/stdlib/test/dummy_h.erl
parent8ca53b0f993ffbf2991e3068b76ec15b8f5eca51 (diff)
downloadotp-db632b91f41c4a01be68d821d6942ff32b86e40b.tar.gz
otp-db632b91f41c4a01be68d821d6942ff32b86e40b.tar.bz2
otp-db632b91f41c4a01be68d821d6942ff32b86e40b.zip
stdlib: Make gen_event callbacks optional
Diffstat (limited to 'lib/stdlib/test/dummy_h.erl')
-rw-r--r--lib/stdlib/test/dummy_h.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/stdlib/test/dummy_h.erl b/lib/stdlib/test/dummy_h.erl
index bc89cb4fde..70c0eafbdf 100644
--- a/lib/stdlib/test/dummy_h.erl
+++ b/lib/stdlib/test/dummy_h.erl
@@ -26,6 +26,8 @@
init(make_error) ->
{error, my_error};
+init({state, State}) ->
+ {ok, State};
init([Parent]) ->
{ok, Parent}; %% We will send special responses for every handled event.
init([Parent,hibernate]) ->
@@ -83,7 +85,9 @@ terminate(swap, State) ->
{ok, State};
terminate({error, {return, faulty}}, Parent) ->
Parent ! {dummy_h, returned_error};
+terminate(_Reason, {undef_in_terminate, {Mod, Fun}}) ->
+ Mod:Fun(),
+ ok;
terminate(_Reason, _State) ->
ok.
-