From b379d700e1450a3fc7e76bb75369fa6b5eb2d327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 13 Sep 2013 12:56:06 +0200 Subject: 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. --- lib/asn1/test/testSeqIndefinite.erl | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'lib/asn1/test/testSeqIndefinite.erl') diff --git a/lib/asn1/test/testSeqIndefinite.erl b/lib/asn1/test/testSeqIndefinite.erl index c7b8aba523..9a9150a9a8 100644 --- a/lib/asn1/test/testSeqIndefinite.erl +++ b/lib/asn1/test/testSeqIndefinite.erl @@ -27,21 +27,13 @@ main(per) -> ok; main(ber) -> %% normal encoding - B = [48,20,1,1,255,48,9,1,1,255,2,4,251,35,238,194,2,4,251,55,236,161], + B = <<48,20,1,1,255,48,9,1,1,255,2,4,251,35,238,194,2,4,251,55,236,161>>, %% indefinite length encoding - Bi = [48,22,1,1,255,48,128,1,1,255,2,4,251,35,238,194,0,0,2,4,251,55,236,161], + Bi = <<48,22,1,1,255,48,128,1,1,255,2,4,251,35,238,194,0,0,2,4,251,55,236,161>>, %% the value which is encoded V = {'SeqS3',true,{'SeqS3_seqS3',true,-81531198},-80221023}, - ?line {ok,V} = asn1_wrapper:decode('SeqSetIndefinite','SeqS3',B), - ?line {ok,V} = asn1_wrapper:decode('SeqSetIndefinite','SeqS3',Bi), - - %% normal encoding but with unknown extension component - _Be = [48,23,1,1,255,48,12,1,1,255,2,4,251,35,238,194,1,1,255,2,4,251,55,236,161], - %% indefinite length encoding but with unknown extension component - _Bei = [48,25,1,1,255,48,128,1,1,255,2,4,251,35,238,194,1,1,255,0,0,2,4,251,55,236,161], - - ?line {ok,V} = asn1_wrapper:decode('SeqSetIndefinite','SeqS3',B), - ?line {ok,V} = asn1_wrapper:decode('SeqSetIndefinite','SeqS3',Bi), + {ok,V} = 'SeqSetIndefinite':decode('SeqS3', B), + {ok,V} = 'SeqSetIndefinite':decode('SeqS3', Bi), ok. -- cgit v1.2.3