aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test
diff options
context:
space:
mode:
authorGustav Simonsson <[email protected]>2012-03-27 11:33:40 +0200
committerGustav Simonsson <[email protected]>2012-03-27 11:33:40 +0200
commit83f2fac3765d75ab46bc3871c2ac9a53d683edeb (patch)
tree05450ca5452905ffe2be08b2bc937e21e146b483 /lib/dialyzer/test
parent3e922e3a1995f7a63d7bf457a6a45a3d8010756f (diff)
parent982d6706df475dc28535d0fe7922573c618bbc36 (diff)
downloadotp-83f2fac3765d75ab46bc3871c2ac9a53d683edeb.tar.gz
otp-83f2fac3765d75ab46bc3871c2ac9a53d683edeb.tar.bz2
otp-83f2fac3765d75ab46bc3871c2ac9a53d683edeb.zip
Merge branch 'sa/dialyzer-R15B01-last-minute-fixes' into maint
* sa/dialyzer-R15B01-last-minute-fixes: Fix bug related with infinitely looping functions Report only actual unknown types otherwise no message is sent Use wx:wx_object() type now that it is exported Up version Add warnings_as_errors option
Diffstat (limited to 'lib/dialyzer/test')
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/maybe_servers.erl31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/dialyzer/test/small_SUITE_data/src/maybe_servers.erl b/lib/dialyzer/test/small_SUITE_data/src/maybe_servers.erl
new file mode 100644
index 0000000000..237f43b1a6
--- /dev/null
+++ b/lib/dialyzer/test/small_SUITE_data/src/maybe_servers.erl
@@ -0,0 +1,31 @@
+-module(maybe_servers).
+
+-export([maybe_server/2, mirror_maybe_server/2]).
+
+maybe_server(O, I) ->
+ case O of
+ no ->
+ maybe_loop(fun(_) -> fin end, I);
+ yes ->
+ maybe_loop(fun(X) -> {ok, X} end, I)
+ end.
+
+maybe_loop(F, X)->
+ case F(X) of
+ {ok, Y} -> maybe_loop(F, Y);
+ fin -> exit(n)
+ end.
+
+mirror_maybe_loop(F, X)->
+ case F(X) of
+ {ok, Y} -> mirror_maybe_loop(F, Y);
+ fin -> exit(n)
+ end.
+
+mirror_maybe_server(O, I) ->
+ case O of
+ no ->
+ mirror_maybe_loop(fun(_) -> fin end, I);
+ yes ->
+ mirror_maybe_loop(fun(X) -> {ok, X} end, I)
+ end.