aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/ber_decode_error.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-09-13 12:56:06 +0200
committerBjörn Gustavsson <[email protected]>2013-09-18 11:45:01 +0200
commitb379d700e1450a3fc7e76bb75369fa6b5eb2d327 (patch)
tree88a7ef2503b735b8cf8f51444e472facbcc2db5a /lib/asn1/test/ber_decode_error.erl
parentb8f57af261d72f9f078ddf7190201209dd846d53 (diff)
downloadotp-b379d700e1450a3fc7e76bb75369fa6b5eb2d327.tar.gz
otp-b379d700e1450a3fc7e76bb75369fa6b5eb2d327.tar.bz2
otp-b379d700e1450a3fc7e76bb75369fa6b5eb2d327.zip
Eliminate the use of asn1_wrapper
The asn1_wrapper made some sense when encode functions could either produce a list or a binary, depending on the backend. Now encode functions always produce a binary. To improve readbility of the test suites, eliminate the asn1_wrapper functions by replacing them with calls to one of the roundtrip functions in asn1_test_lib. When it is not possible to use the roundtrip functions, call the module in question directly. While at it, also remove ?line macros that are near to the touched code and use asn1_test_lib:hex_to_bin/1 instead of home-brewn hex conversion routines.
Diffstat (limited to 'lib/asn1/test/ber_decode_error.erl')
-rw-r--r--lib/asn1/test/ber_decode_error.erl10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/asn1/test/ber_decode_error.erl b/lib/asn1/test/ber_decode_error.erl
index 1c4b4c6894..8be92292ee 100644
--- a/lib/asn1/test/ber_decode_error.erl
+++ b/lib/asn1/test/ber_decode_error.erl
@@ -22,15 +22,15 @@
-export([run/1]).
run([]) ->
- {ok,B} = asn1_wrapper:encode('Constructed','S3',{'S3',17}),
- [T,L|V] = lists:flatten(B),
- Bytes = [T,L+3|V] ++ [2,1,3],
- case asn1_wrapper:decode('Constructed','S3',Bytes) of
+ {ok,B} = 'Constructed':encode('S3', {'S3',17}),
+ [T,L|V] = binary_to_list(B),
+ Bytes = list_to_binary([T,L+3|V] ++ [2,1,3]),
+ case 'Constructed':decode('S3', Bytes) of
{error,{asn1,{unexpected,_}}} -> ok
end,
%% Unexpected bytes must be accepted if there is an extensionmark
- {ok,{'S3ext',17}} = asn1_wrapper:decode('Constructed','S3ext',Bytes),
+ {ok,{'S3ext',17}} = 'Constructed':decode('S3ext', Bytes),
%% Truncated tag.
{error,{asn1,{invalid_tag,_}}} =