aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/behaviour_SUITE_data/src
diff options
context:
space:
mode:
authorGustav Simonsson <[email protected]>2012-03-15 11:35:20 +0100
committerGustav Simonsson <[email protected]>2012-03-15 11:35:20 +0100
commitd789eb25f5e426c5eeeac738ec687e61fe5984ac (patch)
treed6779a22a3b0d491622e389d848d34919c501cb5 /lib/dialyzer/test/behaviour_SUITE_data/src
parent5770544e06548e5aec265eaca487429bcf332b42 (diff)
parentdb9c249a0dd1c948f9bcbc47df166c13e7856357 (diff)
downloadotp-d789eb25f5e426c5eeeac738ec687e61fe5984ac.tar.gz
otp-d789eb25f5e426c5eeeac738ec687e61fe5984ac.tar.bz2
otp-d789eb25f5e426c5eeeac738ec687e61fe5984ac.zip
Merge branch 'maint'
Diffstat (limited to 'lib/dialyzer/test/behaviour_SUITE_data/src')
-rw-r--r--lib/dialyzer/test/behaviour_SUITE_data/src/custom_sup.erl37
-rw-r--r--lib/dialyzer/test/behaviour_SUITE_data/src/sample_behaviour/sample_callback_wrong.erl3
2 files changed, 39 insertions, 1 deletions
diff --git a/lib/dialyzer/test/behaviour_SUITE_data/src/custom_sup.erl b/lib/dialyzer/test/behaviour_SUITE_data/src/custom_sup.erl
new file mode 100644
index 0000000000..8ec84d798f
--- /dev/null
+++ b/lib/dialyzer/test/behaviour_SUITE_data/src/custom_sup.erl
@@ -0,0 +1,37 @@
+%%% Dialyzer was giving a warning with this input because of a bug in the
+%%% substitution of remote types in specs. Remote types in the first element of
+%%% a tuple would not update the tuple's tag set and we could end up with a
+%%% non-normalized representation.
+%%%
+%%% Reported by Damian DobroczyƄski on 29/02/2012
+
+-module(custom_sup).
+
+-behavior(supervisor).
+
+-export([init/1]).
+
+-spec init(atom()) ->
+ {ok, {{supervisor:strategy(), non_neg_integer(), non_neg_integer()},
+ [supervisor:child_spec()]}} | ignore.
+
+init(StorageName) ->
+ Strategy = {one_for_all, 100, 1},
+ %% get application-wide storage parameters
+ case application:get_env(storage) of
+ undefined ->
+ ignore;
+ {ok, Storage} ->
+ BackendId = proplists:get_value(backend, Storage),
+ BackendArgs = proplists:get_value(args, Storage),
+ if
+ (BackendId =:= undefined) orelse (BackendArgs =:= undefined) ->
+ ignore;
+ true ->
+ {ok, {Strategy,
+ [{id1, {a_module, start_link, []},
+ permanent, 5000, worker, [a_module]},
+ {id2, {another_module, start_link, []},
+ permanent, 5000, worker, [another_module]}]}}
+ end
+ end.
diff --git a/lib/dialyzer/test/behaviour_SUITE_data/src/sample_behaviour/sample_callback_wrong.erl b/lib/dialyzer/test/behaviour_SUITE_data/src/sample_behaviour/sample_callback_wrong.erl
index 02a063fab7..430494c48c 100644
--- a/lib/dialyzer/test/behaviour_SUITE_data/src/sample_behaviour/sample_callback_wrong.erl
+++ b/lib/dialyzer/test/behaviour_SUITE_data/src/sample_behaviour/sample_callback_wrong.erl
@@ -1,6 +1,7 @@
-module(sample_callback_wrong).
--behaviour(sample_behaviour).
+%% This attribute uses the american spelling of 'behaviour'.
+-behavior(sample_behaviour).
-export([
% sample_callback_1/0,