aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-04-30 19:01:47 +0300
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-04-30 19:01:47 +0300
commitfddd6110e00df12c99a20a2cc9d074f5f4f1f965 (patch)
tree366575b855f1b2013db7eeb02ecb213f81c98c1f /test
parentMerge branch 'new-option-validation' (diff)
Don't validate an option in gen_mod:get*opt() functions
The changes are very similar to those from previous commit: * Now there is no need to pass validating function in gen_mod:get_opt() and gen_mod:get_module_opt() functions, because the modules' configuration keeps already validated values. * New functions gen_mod:get_opt/2 and gen_mod:get_module_opt/3 are introduced. * Functions gen_mod:get_opt/4 and get_module_opt/5 are deprecated. If the functions are still called, the "function" argument is simply ignored. * Validating callback Mod:listen_opt_type/1 is introduced to validate listening options at startup.
Diffstat (limited to 'test')
-rw-r--r--test/mod_legacy.erl3
-rw-r--r--test/muc_tests.erl8
2 files changed, 3 insertions, 8 deletions
diff --git a/test/mod_legacy.erl b/test/mod_legacy.erl
index eedfbd3b5..00fd44040 100644
--- a/test/mod_legacy.erl
+++ b/test/mod_legacy.erl
@@ -32,8 +32,7 @@
%%% API
%%%===================================================================
start(Host, Opts) ->
- IQDisc = gen_mod:get_opt(iqdisc, Opts, fun gen_iq_handler:check_type/1,
- one_queue),
+ IQDisc = gen_mod:get_opt(iqdisc, Opts, one_queue),
gen_iq_handler:add_iq_handler(ejabberd_local, Host, ?NS_EVENT,
?MODULE, process_iq, IQDisc).
diff --git a/test/muc_tests.erl b/test/muc_tests.erl
index eb869cad6..9ded2e0fe 100644
--- a/test/muc_tests.erl
+++ b/test/muc_tests.erl
@@ -441,9 +441,7 @@ history_master(Config) ->
MyNick = ?config(nick, Config),
MyNickJID = jid:replace_resource(Room, MyNick),
PeerNickJID = peer_muc_jid(Config),
- Size = gen_mod:get_module_opt(ServerHost, mod_muc, history_size,
- fun(I) when is_integer(I), I>=0 -> I end,
- 20),
+ Size = gen_mod:get_module_opt(ServerHost, mod_muc, history_size, 20),
ok = join_new(Config),
ct:comment("Putting ~p+1 messages in the history", [Size]),
%% Only Size messages will be stored
@@ -471,9 +469,7 @@ history_slave(Config) ->
PeerNick = ?config(peer_nick, Config),
PeerNickJID = jid:replace_resource(Room, PeerNick),
ServerHost = ?config(server_host, Config),
- Size = gen_mod:get_module_opt(ServerHost, mod_muc, history_size,
- fun(I) when is_integer(I), I>=0 -> I end,
- 20),
+ Size = gen_mod:get_module_opt(ServerHost, mod_muc, history_size, 20),
ct:comment("Waiting for 'join' command from the master"),
join = get_event(Config),
{History, _, _} = join(Config),