aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test/diameter_codec_SUITE.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2011-12-06 16:19:09 +0100
committerAnders Svensson <[email protected]>2011-12-16 18:25:29 +0100
commit859d9471d15422debf974294223a33e15c728e46 (patch)
tree75459596d614401c418bd614ca6f3084ef71b199 /lib/diameter/test/diameter_codec_SUITE.erl
parenta2b669fdb9615705f4b91f0ccbb979048e8cce51 (diff)
downloadotp-859d9471d15422debf974294223a33e15c728e46.tar.gz
otp-859d9471d15422debf974294223a33e15c728e46.tar.bz2
otp-859d9471d15422debf974294223a33e15c728e46.zip
Add codec testcase for decode of unknown AVPs
Diffstat (limited to 'lib/diameter/test/diameter_codec_SUITE.erl')
-rw-r--r--lib/diameter/test/diameter_codec_SUITE.erl28
1 files changed, 26 insertions, 2 deletions
diff --git a/lib/diameter/test/diameter_codec_SUITE.erl b/lib/diameter/test/diameter_codec_SUITE.erl
index 30c60be8e9..2e219bbb10 100644
--- a/lib/diameter/test/diameter_codec_SUITE.erl
+++ b/lib/diameter/test/diameter_codec_SUITE.erl
@@ -35,7 +35,8 @@
%% testcases
-export([base/1,
gen/1,
- lib/1]).
+ lib/1,
+ unknown/1]).
-include("diameter_ct.hrl").
@@ -47,7 +48,7 @@ suite() ->
[{timetrap, {seconds, 10}}].
all() ->
- [base, gen, lib].
+ [base, gen, lib, unknown].
init_per_testcase(gen, Config) ->
[{application, ?APP, App}] = diameter_util:consult(?APP, app),
@@ -74,3 +75,26 @@ gen([{dicts, Ms} | _]) ->
lib(_Config) ->
diameter_codec_test:lib().
+
+%% Have a separate AVP dictionary just to exercise more code.
+unknown(Config) ->
+ Priv = proplists:get_value(priv_dir, Config),
+ Data = proplists:get_value(data_dir, Config),
+ ok = make(Data, "recv.dia"),
+ ok = make(Data, "avps.dia"),
+ {ok, _, _} = compile("diameter_test_avps.erl"),
+ ok = make(Data, "send.dia"),
+ {ok, _, _} = compile("diameter_test_send.erl"),
+ {ok, _, _} = compile("diameter_test_recv.erl"),
+ {ok, _, _} = compile(filename:join([Data, "diameter_test_unknown.erl"]),
+ [{i, Priv}]),
+ diameter_test_unknown:run().
+
+make(Dir, File) ->
+ diameter_make:codec(filename:join([Dir, File])).
+
+compile(File) ->
+ compile(File, []).
+
+compile(File, Opts) ->
+ compile:file(File, [return | Opts]).