aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-06-11 13:59:02 +0200
committerAnders Svensson <[email protected]>2017-06-13 13:50:07 +0200
commit205521d3927ed6f53c9a6fa3095f8a879bdca929 (patch)
tree7eda323ec84c0cb19bd55dd95735636bc08c6c11 /lib/diameter/test
parentcac106defc5060c5e485480e8003b992482d751d (diff)
downloadotp-205521d3927ed6f53c9a6fa3095f8a879bdca929.tar.gz
otp-205521d3927ed6f53c9a6fa3095f8a879bdca929.tar.bz2
otp-205521d3927ed6f53c9a6fa3095f8a879bdca929.zip
Move (most of) diameter_gen.hrl to diameter_gen.erl
To remove the requirement that dictionary modules be recompiled whenever the encode/decode implementation changes. The included diameter_gen.hrl now only contains trivial functions that call info diameter_gen.erl.
Diffstat (limited to 'lib/diameter/test')
-rw-r--r--lib/diameter/test/diameter_codec_test.erl5
-rw-r--r--lib/diameter/test/diameter_compiler_SUITE.erl2
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/diameter/test/diameter_codec_test.erl b/lib/diameter/test/diameter_codec_test.erl
index ccb97615da..b548f85cb8 100644
--- a/lib/diameter/test/diameter_codec_test.erl
+++ b/lib/diameter/test/diameter_codec_test.erl
@@ -171,7 +171,7 @@ gen(M, avp_types, {Name, Code, Type, _Flags}) ->
V = undefined /= VendorId,
V = 0 /= Flags band 2#10000000,
{Name, Type} = M:avp_name(Code, VendorId),
- B = M:empty_value(Name),
+ B = M:empty_value(Name, #{module => M}),
B = z(B),
[] = avp_decode(M, Type, Name);
@@ -215,7 +215,8 @@ avp(Mod, encode = X, V, Name, _) ->
iolist_to_binary(Mod:avp(X, V, Name, opts(Mod))).
opts(Mod) ->
- (opts())#{dictionary => Mod}.
+ (opts())#{module => Mod,
+ dictionary => Mod}.
opts() ->
#{string_decode => true,
diff --git a/lib/diameter/test/diameter_compiler_SUITE.erl b/lib/diameter/test/diameter_compiler_SUITE.erl
index dea14e3870..73fe1ef6e0 100644
--- a/lib/diameter/test/diameter_compiler_SUITE.erl
+++ b/lib/diameter/test/diameter_compiler_SUITE.erl
@@ -552,7 +552,7 @@ flatten2(_Config) ->
T <- [encode, decode],
M <- [M2, M3],
Ref <- [make_ref()],
- RC <- [M:avp(T, Ref, A, #{})],
+ RC <- [M:avp(T, Ref, A, #{module => M})],
RC /= {T, Ref}].
'A1'(T, 'Unsigned32', Ref, _Opts) ->