diff options
author | Björn Gustavsson <[email protected]> | 2012-11-26 11:53:23 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-11-26 11:53:23 +0100 |
commit | 1204bb9dc739a80557fb1fa6e35cc113bf943823 (patch) | |
tree | c7f9030962b5d78e01dbd4137e915eb61e55f26f /lib/asn1/test/testTimer.erl | |
parent | b4db457fdf813de7046056a0cf71ec104af8b871 (diff) | |
parent | 66ae461376c17806b25b8165d8ff86782fbacfa6 (diff) | |
download | otp-1204bb9dc739a80557fb1fa6e35cc113bf943823.tar.gz otp-1204bb9dc739a80557fb1fa6e35cc113bf943823.tar.bz2 otp-1204bb9dc739a80557fb1fa6e35cc113bf943823.zip |
Merge branch 'bjorn/asn1/clean-up-backends/OTP-10410'
* bjorn/asn1/clean-up-backends/OTP-10410:
Simplify the code for the generated info/0 function
Don't try to work around a non-loadable NIF library
Fix BER encoding when multiple levels of typedefs are used
Update megaco documentation
Update documentation for the asn1 application
Fix other applications
Fix use of asn1 in megaco
Remove the unused asn1ct_gen_ber module
Remove the unused asn1ct_constructed_ber module
Remove the unused asn1ct_per_bin module
Remove unused functions in asn1rt_ber_bin
Remove obsolete back-ends and simplify the options
Make the specialized decodes work with the 'nif' option
Remove support for the obsolete {Typename,Value} tuple notation
Remove tests for the obsolete {TypeName,Value} notation
Remove the obsolete and deprecated 'keyed_list' option
Diffstat (limited to 'lib/asn1/test/testTimer.erl')
-rw-r--r-- | lib/asn1/test/testTimer.erl | 53 |
1 files changed, 10 insertions, 43 deletions
diff --git a/lib/asn1/test/testTimer.erl b/lib/asn1/test/testTimer.erl index 2d3b777558..cd7ceb5630 100644 --- a/lib/asn1/test/testTimer.erl +++ b/lib/asn1/test/testTimer.erl @@ -133,23 +133,7 @@ go(Config,Enc) -> Module = 'H323-MESSAGES', Type = 'H323-UserInformation', Value = val(), -%% ok = asn1ct:compile(HelpModule,[Enc]), - -%% ok = asn1ct:compile(Module,[Enc]), - ?line {ok,B} = asn1rt:encode(Module,Type,Value), - Bytes = case Enc of - ber_bin -> - list_to_binary(B); - per_bin when is_list(B) -> - list_to_binary(B); - per_bin -> - B; - uper_bin -> - B; - _ -> - %%lists:flatten(B) - list_to_binary(B) - end, + {ok,Bytes} = asn1rt:encode(Module,Type,Value), CompileOptions = compile_options(), @@ -181,35 +165,18 @@ encode(N, Module,Type,Value) -> decode(0, _Module,_Type,_Value,_Erule) -> done; decode(N, Module,Type,Value,Erule) -> - case Erule of - ber -> - ?line {ok,_B} = asn1rt:decode(Module,Type,binary_to_list(Value)); - per -> - ?line {ok,_B} = asn1rt:decode(Module,Type,binary_to_list(Value)); - _ -> - ?line {ok,_B} = asn1rt:decode(Module,Type,Value) - end, + {ok,_B} = asn1rt:decode(Module,Type,Value), decode(N-1, Module,Type,Value,Erule). compile_options() -> - ?line {ok,Info} = asn1rt:info('H323-MESSAGES'), - case lists:keysearch(options,1,Info) of - {_,{_,Opts}} -> - Opts2 = - case lists:member(ber_bin_v2,Opts) of - true -> - [ber_bin,optimize] ++ lists:delete(optimize,Opts); - _ -> - Opts - end, - Opts3 = [X||X <- Opts2, - (X == ber orelse - X == ber_bin orelse - X == per orelse - X == per_bin orelse - X == optimize orelse - X == driver)], - lists:flatten(io_lib:format("~p",[Opts3])); + {ok,Info} = asn1rt:info('H323-MESSAGES'), + case lists:keyfind(options, 1, Info) of + {_,Opts0} -> + Opts1 = [X || X <- Opts0, + (X =:= ber orelse + X =:= per orelse + X =:= uper)], + lists:flatten(io_lib:format("~p", [Opts1])); _ -> "[]" end. |