From 5b38a4a2543681cde7289eff98cdb078ea2ee1fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 18 Mar 2016 12:30:31 +0100 Subject: Eliminate ?line macros --- lib/asn1/test/asn1_SUITE_data/test_records.erl | 16 +++--- lib/asn1/test/testMergeCompile.erl | 14 ++--- lib/asn1/test/testNBAPsystem.erl | 12 ++--- lib/asn1/test/testParameterizedInfObj.erl | 2 +- lib/asn1/test/testSSLspecs.erl | 42 +++++++-------- lib/asn1/test/testSeqOfIndefinite.erl | 14 ++--- lib/asn1/test/testTCAP.erl | 16 +++--- lib/asn1/test/test_compile_options.erl | 63 +++++++++++------------ lib/asn1/test/test_partial_incomplete_decode.erl | 56 ++++++++++---------- lib/asn1/test/test_special_decode_performance.erl | 22 ++++---- 10 files changed, 125 insertions(+), 132 deletions(-) (limited to 'lib') diff --git a/lib/asn1/test/asn1_SUITE_data/test_records.erl b/lib/asn1/test/asn1_SUITE_data/test_records.erl index 65716bb0dc..8f65d887c9 100644 --- a/lib/asn1/test/asn1_SUITE_data/test_records.erl +++ b/lib/asn1/test/asn1_SUITE_data/test_records.erl @@ -45,19 +45,19 @@ check_record_names({initiatingMessage, transactionID = _TransactionID, value = Value}}) -> - ?line ok = check_record_ProcedureID(ProcedureID), - ?line ok = check_record_Value(Value). + ok = check_record_ProcedureID(ProcedureID), + ok = check_record_Value(Value). check_record_ProcedureID(#'ProcedureID'{}) -> ok; check_record_ProcedureID(_) -> false. check_record_Value(#'ResourceStatusIndication'{protocolIEs = ProtocolIEs}) -> - ?line ok = check_record_ProtocolIEs(ProtocolIEs); + ok = check_record_ProtocolIEs(ProtocolIEs); check_record_Value(_) -> false. check_record_ProtocolIEs([#'ProtocolIE-Field'{value =IndicationType}|_]) -> - ?line ok = check_record_NFResourceStatusInd(IndicationType); + ok = check_record_NFResourceStatusInd(IndicationType); check_record_ProtocolIEs(_) -> false. check_record_NFResourceStatusInd({'no-Failure',#'No-Failure-ResourceStatusInd'{'local-Cell-InformationList'=[LCIPF]}}) -> @@ -65,13 +65,13 @@ check_record_NFResourceStatusInd({'no-Failure',#'No-Failure-ResourceStatusInd'{' check_record_NFResourceStatusInd(_) -> false. 'check_record_NFResourceStatusInd_ProtocolIE-Field'(#'ProtocolIE-Field'{value=LCI}) -> - ?line ok = check_record_LCInfoResourceStatusInd(LCI); + ok = check_record_LCInfoResourceStatusInd(LCI); 'check_record_NFResourceStatusInd_ProtocolIE-Field'(_) -> false. check_record_LCInfoResourceStatusInd(#'Local-Cell-InformationItem-ResourceStatusInd'{commonChannelsCapacityConsumptionLaw=[CCCCL],dedicatedChannelsCapacityConsumptionLaw=[DCCCL],'iE-Extensions' = [LCIRE]}) -> - ?line ok = check_record_CCCCL(CCCCL), - ?line ok = check_record_DCCCL(DCCCL), - ?line ok = check_record_LCIRE(LCIRE). + ok = check_record_CCCCL(CCCCL), + ok = check_record_DCCCL(DCCCL), + ok = check_record_LCIRE(LCIRE). check_record_CCCCL(#'CommonChannelsCapacityConsumptionLaw_SEQOF'{}) -> ok; diff --git a/lib/asn1/test/testMergeCompile.erl b/lib/asn1/test/testMergeCompile.erl index 5011c7d576..1feac361e1 100644 --- a/lib/asn1/test/testMergeCompile.erl +++ b/lib/asn1/test/testMergeCompile.erl @@ -66,16 +66,16 @@ main(Erule) -> mvrasn(Erule) -> case Erule of ber -> - ?line ok = test(isd), - ?line ok = test(isd2), - ?line ok = test(dsd), - ?line ok = test(ul_res), - ?line ok = test(seqofseq), - ?line ok = test('InsertSubscriberDataArg'); + ok = test(isd), + ok = test(isd2), + ok = test(dsd), + ok = test(ul_res), + ok = test(seqofseq), + ok = test('InsertSubscriberDataArg'); _ -> ok end, - ?line ok = test(mvrasn6,'InsertSubscriberDataArg'). + ok = test(mvrasn6,'InsertSubscriberDataArg'). test(isd)-> EncPdu = <<48,128,129,7,145,148,113,50,1,0,241,131,1,0,176,128,5,0, diff --git a/lib/asn1/test/testNBAPsystem.erl b/lib/asn1/test/testNBAPsystem.erl index 2a7e39597a..5e1c16a1a0 100644 --- a/lib/asn1/test/testNBAPsystem.erl +++ b/lib/asn1/test/testNBAPsystem.erl @@ -92,23 +92,23 @@ compile(Config, Options) -> test(_Erule,Config) -> - ?line ok = enc_audit_req_msg(), - ?line ok = cell_setup_req_msg_test(), + ok = enc_audit_req_msg(), + ok = cell_setup_req_msg_test(), ticket_5812(Config). ticket_5812(Config) -> - ?line Msg = v_5812(), + Msg = v_5812(), {ok,B2} = 'NBAP-PDU-Discriptions':encode('NBAP-PDU', Msg), V = <<0,28,74,0,3,48,0,0,1,0,123,64,41,0,0,0,126,64,35,95,208,2,89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,145,0,1,205,0,0,0,0,2,98,64,1,128>>, - ?line ok = compare(V,B2), + ok = compare(V,B2), {ok,Msg2} = 'NBAP-PDU-Discriptions':decode('NBAP-PDU', B2), - ?line ok = check_record_names(Msg2,Config). + ok = check_record_names(Msg2,Config). enc_audit_req_msg() -> Msg = {initiatingMessage, audit_req_msg()}, {ok,B} = 'NBAP-PDU-Discriptions':encode('NBAP-PDU', Msg), {ok,_Msg} = 'NBAP-PDU-Discriptions':decode('NBAP-PDU', B), - ?line {initiatingMessage, + {initiatingMessage, #'InitiatingMessage'{value=#'AuditRequest'{protocolIEs=[{_,114,ignore,_}], protocolExtensions = asn1_NOVALUE}}} = _Msg, io:format("Msg: ~n~P~n~n_Msg:~n~P~n",[Msg,15,_Msg,15]), diff --git a/lib/asn1/test/testParameterizedInfObj.erl b/lib/asn1/test/testParameterizedInfObj.erl index 8b0353522d..63fa2fcf09 100644 --- a/lib/asn1/test/testParameterizedInfObj.erl +++ b/lib/asn1/test/testParameterizedInfObj.erl @@ -97,7 +97,7 @@ roundtrip(T, V) -> ranap(_Erule) -> PIEVal2 = [{'ProtocolIE-Field',4,ignore,{radioNetwork,'rab-pre-empted'}}], - ?line Val2 = + Val2 = #'InitiatingMessage'{procedureCode=1, criticality=ignore, value=#'Iu-ReleaseCommand'{protocolIEs=PIEVal2, diff --git a/lib/asn1/test/testSSLspecs.erl b/lib/asn1/test/testSSLspecs.erl index 7dc7eedd50..035912d767 100644 --- a/lib/asn1/test/testSSLspecs.erl +++ b/lib/asn1/test/testSSLspecs.erl @@ -52,8 +52,8 @@ compile_combined(Config, ber=Rule) -> asn1_test_lib:compile("OTP-PKIX.set.asn", Config, Options). remove_db_files(Dir) -> - ?line ok = remove_db_file(Dir ++ "PKIX1Explicit93.asn1db"), - ?line ok = remove_db_file(Dir ++ "PKIX1Implicit93.asn1db"). + ok = remove_db_file(Dir ++ "PKIX1Explicit93.asn1db"), + ok = remove_db_file(Dir ++ "PKIX1Implicit93.asn1db"). remove_db_file(File) -> case file:delete(File) of ok -> @@ -65,23 +65,23 @@ remove_db_file(File) -> end. remove_db_files_combined(Dir) -> - ?line ok = remove_db_file(Dir ++ "OTP-PKIX.asn1db"), - ?line ok = remove_db_file(Dir ++ "SSL-PKIX.asn1db"), - ?line ok = remove_db_file(Dir ++ "PKIXAttributeCertificate.asn1db"), - ?line ok = remove_db_file(Dir ++ "PKIX1Algorithms88.asn1db"), - ?line ok = remove_db_file(Dir ++ "PKIX1Explicit88.asn1db"), - ?line ok = remove_db_file(Dir ++ "PKIX1Implicit88.asn1db"). + ok = remove_db_file(Dir ++ "OTP-PKIX.asn1db"), + ok = remove_db_file(Dir ++ "SSL-PKIX.asn1db"), + ok = remove_db_file(Dir ++ "PKIXAttributeCertificate.asn1db"), + ok = remove_db_file(Dir ++ "PKIX1Algorithms88.asn1db"), + ok = remove_db_file(Dir ++ "PKIX1Explicit88.asn1db"), + ok = remove_db_file(Dir ++ "PKIX1Implicit88.asn1db"). run(ber) -> run1(1). run1(6) -> - ?line f1(6), - ?line f2(6), - ?line transform4(ex(7)); + f1(6), + f2(6), + transform4(ex(7)); run1(N) -> - ?line f1(N), - ?line f2(N), + f1(N), + f2(N), run1(N+1). @@ -93,22 +93,22 @@ f2(N) -> transform1(ATAV) -> - ?line {ok, ATAVEnc} = 'PKIX1Explicit88':encode('AttributeTypeAndValue', + {ok, ATAVEnc} = 'PKIX1Explicit88':encode('AttributeTypeAndValue', ATAV), - ?line {ok, _ATAVDec} = 'SSL-PKIX':decode('AttributeTypeAndValue', + {ok, _ATAVDec} = 'SSL-PKIX':decode('AttributeTypeAndValue', ATAVEnc). transform2(ATAV) -> - ?line {ok, ATAVEnc} = 'PKIX1Explicit88':encode('AttributeTypeAndValue', + {ok, ATAVEnc} = 'PKIX1Explicit88':encode('AttributeTypeAndValue', ATAV), - ?line {ok, _ATAVDec} = 'PKIX1Explicit88':decode('AttributeTypeAndValue', + {ok, _ATAVDec} = 'PKIX1Explicit88':decode('AttributeTypeAndValue', ATAVEnc). transform4(ATAV) -> - ?line {ok, ATAVEnc} = 'PKIX1Explicit88':encode('Attribute', + {ok, ATAVEnc} = 'PKIX1Explicit88':encode('Attribute', ATAV), - ?line {ok, _ATAVDec} = 'PKIX1Explicit88':decode('Attribute', + {ok, _ATAVDec} = 'PKIX1Explicit88':decode('Attribute', ATAVEnc). @@ -144,8 +144,8 @@ ex(7) -> run_combined(ber) -> Cert = cert(), - ?line {ok,{'CertificatePKIX1Explicit88',{Type,UnDec},_,_}} = 'OTP-PKIX':decode_TBSCert_exclusive(Cert), - ?line {ok,_} = 'OTP-PKIX':decode_part(Type,UnDec), + {ok,{'CertificatePKIX1Explicit88',{Type,UnDec},_,_}} = 'OTP-PKIX':decode_TBSCert_exclusive(Cert), + {ok,_} = 'OTP-PKIX':decode_part(Type,UnDec), ok. cert() -> diff --git a/lib/asn1/test/testSeqOfIndefinite.erl b/lib/asn1/test/testSeqOfIndefinite.erl index bebd516c5c..e28b9e0fd3 100644 --- a/lib/asn1/test/testSeqOfIndefinite.erl +++ b/lib/asn1/test/testSeqOfIndefinite.erl @@ -25,13 +25,13 @@ -include_lib("common_test/include/ct.hrl"). main() -> - ?line ok = test(isd), - ?line ok = test(isd2), - ?line ok = test(dsd), - ?line ok = test(ul_res), - ?line ok = test(prim), - ?line ok = test(seqofseq), - ?line ok = test('InsertSubscriberDataArg'). % OTP-4232 + ok = test(isd), + ok = test(isd2), + ok = test(dsd), + ok = test(ul_res), + ok = test(prim), + ok = test(seqofseq), + ok = test('InsertSubscriberDataArg'). % OTP-4232 test(isd)-> EncPdu = <<48,128,129,7,145,148,113,50,1,0,241,131,1,0,176,128,5,0, diff --git a/lib/asn1/test/testTCAP.erl b/lib/asn1/test/testTCAP.erl index 6e777875f6..48a9f049ca 100644 --- a/lib/asn1/test/testTCAP.erl +++ b/lib/asn1/test/testTCAP.erl @@ -39,7 +39,6 @@ compile_asn1config(Config, Options) -> asn1_test_lib:compile_erlang("TCAPPackage_msg", Config, []). test(Erule,_Config) -> -% ?line OutDir = ?config(priv_dir,Config), %% testing OTP-4798, open type encoded with indefinite length {ok,_Res} = 'TCAPMessages-simple':decode('MessageType', val_OTP_4798(Erule)), @@ -49,20 +48,17 @@ test(Erule,_Config) -> val_OTP_4799(Erule)), %% testing vance shipley's problems. Parameterized object sets. - ?line Val3 = 'TCAPPackage_msg':val('PackageType',unidirectional), + Val3 = 'TCAPPackage_msg':val('PackageType',unidirectional), Res3 = enc_dec('PackageType', Val3), - ?line ok = 'TCAPPackage_msg':check_result('PackageType',unidirectional,Res3), -%% ?line io:format("Res3:~n~p~n~n",[Res3]), + ok = 'TCAPPackage_msg':check_result('PackageType',unidirectional,Res3), - ?line Val4 = 'TCAPPackage_msg':val('PackageType',abort), + Val4 = 'TCAPPackage_msg':val('PackageType',abort), Res4 = enc_dec('PackageType', Val4), - ?line ok = 'TCAPPackage_msg':check_result('PackageType',abort,Res4), -%% ?line io:format("Res4:~n~p~n~n",[Res4]), + ok = 'TCAPPackage_msg':check_result('PackageType',abort,Res4), - ?line Val5 = 'TCAPPackage_msg':val('PackageType',response), + Val5 = 'TCAPPackage_msg':val('PackageType',response), Res5 = enc_dec('PackageType', Val5), - ?line ok = 'TCAPPackage_msg':check_result('PackageType',response,Res5). -%% ?line io:format("Res5:~n~p~n~n",[Res5]). + ok = 'TCAPPackage_msg':check_result('PackageType',response,Res5). val_OTP_4798(ber) -> [100,129,176,73,4,57,3,17,80,107,42,40,40,6,7,0,17,134,5,1,1,1,160,29,97,27,128,2,7,128,161,9,6,7,4,0,0,1,0,14,2,162,3,2,1,0,163,5,161,3,2,1,0,108,128,162,120,2,1,0,48,115,2,1,56,48,128,48,34,4,16,203,87,215,196,217,93,235,90,64,131,106,145,39,26,25,236,4,4,197,241,81,112,4,8,78,225,34,196,215,212,200,0,48,34,4,16,145,125,27,67,42,144,6,161,207,112,55,75,200,191,191,28,4,4,226,219,242,123,4,8,72,46,130,28,206,178,168,0,48,34,4,16,1,8,20,29,70,160,218,160,125,188,244,174,113,115,253,245,4,4,26,5,90,160,4,8,252,75,149,98,153,224,140,0,0,0,0,0]; diff --git a/lib/asn1/test/test_compile_options.erl b/lib/asn1/test/test_compile_options.erl index 1af614f49a..e9806a7670 100644 --- a/lib/asn1/test/test_compile_options.erl +++ b/lib/asn1/test/test_compile_options.erl @@ -41,7 +41,7 @@ wrong_path(Config) -> comp(Parent,Config) -> DataDir = ?config(data_dir,Config), OutDir = ?config(priv_dir,Config), - ?line Err=asn1ct:compile(DataDir++"NoImport",[{i,OutDir},{i,filename:join([DataDir,"subdir"])},{outdir,OutDir}]), + Err=asn1ct:compile(DataDir++"NoImport",[{i,OutDir},{i,filename:join([DataDir,"subdir"])},{outdir,OutDir}]), Parent!Err. %% OTP-5701 @@ -50,17 +50,17 @@ path(Config) -> DataDir = ?config(data_dir,Config), OutDir = ?config(priv_dir,Config), {ok,CWD} = file:get_cwd(), - ?line file:set_cwd(filename:join([DataDir,subdir])), + file:set_cwd(filename:join([DataDir,subdir])), ok = asn1ct:compile("../MyMerge.set.asn",[{outdir,OutDir}]), - ?line ok=outfiles_check(OutDir), - ?line outfiles_remove(OutDir), + ok=outfiles_check(OutDir), + outfiles_remove(OutDir), file:set_cwd(filename:join([DataDir,subdir,subsubdir])), ok = asn1ct:compile('../../MyMerge.set.asn',[{i,'..'},{outdir,OutDir}]), - ?line ok=outfiles_check(OutDir,outfiles2()), + ok=outfiles_check(OutDir,outfiles2()), file:set_cwd(CWD), ok. @@ -73,16 +73,15 @@ noobj(Config) -> code:purge('P-Record'), file:delete(filename:join([OutDir,'P-Record.erl'])), file:delete(filename:join([OutDir,'P-Record.beam'])), - ?line ok=asn1ct:compile(filename:join([DataDir,"P-Record"]), + ok=asn1ct:compile(filename:join([DataDir,"P-Record"]), [noobj,{outdir,OutDir}]), -% ?line false = code:is_loaded('P-Record'), - ?line {ok,_} = file:read_file_info(filename:join([OutDir, + {ok,_} = file:read_file_info(filename:join([OutDir, "P-Record.erl"])), - ?line {error,enoent} = + {error,enoent} = file:read_file_info(filename:join([OutDir,"P-Record.beam"])), - ?line {ok,_} = c:c(filename:join([OutDir,'P-Record']), + {ok,_} = c:c(filename:join([OutDir,'P-Record']), [{i,OutDir},{outdir,OutDir}]), - ?line {file,_} = code:is_loaded('P-Record'), + {file,_} = code:is_loaded('P-Record'), code:purge('P-Record'), code:delete('P-Record'), @@ -94,22 +93,20 @@ noobj(Config) -> file:delete(filename:join([OutDir,'p_record.beam'])), ok = asn1ct:compile(filename:join([DataDir,"p_record.set.asn"]), [asn1config,ber,noobj,{outdir,OutDir}]), -%% ?line false = code:is_loaded('P-Record'), -%% ?line false = code:is_loaded('p_record'), - ?line {error,enoent} = + {error,enoent} = file:read_file_info(filename:join([OutDir,"P-Record.beam"])), - ?line {error,enoent} = + {error,enoent} = file:read_file_info(filename:join([OutDir,"P-Record.erl"])), - ?line {error,enoent} = + {error,enoent} = file:read_file_info(filename:join([OutDir,"p_record.beam"])), io:format("read_file_info: p_record.erl~n",[]), - ?line {ok,_} = + {ok,_} = file:read_file_info(filename:join([OutDir,"p_record.erl"])), io:format("c:c: p_record.erl~n",[]), - ?line {ok,_} = c:c(filename:join([OutDir,'p_record']), + {ok,_} = c:c(filename:join([OutDir,'p_record']), [{i,OutDir},{outdir,OutDir}]), io:format("code:is_loaded: p_record.erl~n",[]), - ?line {file,_} = code:is_loaded('p_record'), + {file,_} = code:is_loaded('p_record'), io:format("file:delete: p_record.erl~n",[]), file:delete(filename:join([OutDir,'p_record.erl'])), file:delete(filename:join([OutDir,'p_record.beam'])). @@ -120,17 +117,17 @@ verbose(Config) when is_list(Config) -> Asn1File = filename:join([DataDir,"Comment.asn"]), %% Test verbose compile - ?line test_server:capture_start(), - ?line ok = asn1ct:compile(Asn1File, [{i,DataDir},{outdir,OutDir},noobj,verbose]), - ?line test_server:capture_stop(), - ?line [Line0|_] = test_server:capture_get(), - ?line true = lists:prefix("Erlang ASN.1 compiler", Line0), + test_server:capture_start(), + ok = asn1ct:compile(Asn1File, [{i,DataDir},{outdir,OutDir},noobj,verbose]), + test_server:capture_stop(), + [Line0|_] = test_server:capture_get(), + true = lists:prefix("Erlang ASN.1 compiler", Line0), %% Test non-verbose compile - ?line test_server:capture_start(), - ?line ok = asn1ct:compile(Asn1File, [{i,DataDir},{outdir,OutDir},noobj]), - ?line test_server:capture_stop(), - ?line [] = test_server:capture_get(), + test_server:capture_start(), + ok = asn1ct:compile(Asn1File, [{i,DataDir},{outdir,OutDir},noobj]), + test_server:capture_stop(), + [] = test_server:capture_get(), ok. outfiles_check(OutDir) -> @@ -141,7 +138,7 @@ outfiles_check(_OutDir,[])-> ok; outfiles_check(OutDir,[H|T]) -> io:format("File: ~p~n",[filename:join([OutDir,H])]), - ?line {ok,_}=file:read_file_info(filename:join([OutDir,H])), + {ok,_}=file:read_file_info(filename:join([OutDir,H])), outfiles_check(OutDir,T). outfiles1() -> @@ -165,15 +162,15 @@ b_SeqIn(DataDir,OutDir) -> [{record_name_prefix,"b_"},{outdir,OutDir}]), io:format("FileName: ~p~nOutDir:~p~n", [filename:join([DataDir,'b_SeqIn']),OutDir]), - ?line {ok,_} = compile:file(filename:join([DataDir,'b_SeqIn']), + {ok,_} = compile:file(filename:join([DataDir,'b_SeqIn']), [{i,OutDir}]), - ?line 'b_SeqIn' = b_SeqIn:record_name(), + 'b_SeqIn' = b_SeqIn:record_name(), ok. a_SeqIn(DataDir,OutDir) -> asn1ct:compile(filename:join([DataDir,'Seq']), [{record_name_prefix,"a_"},{outdir,OutDir}]), - ?line {ok,_} = compile:file(filename:join([DataDir,'a_SeqIn']), + {ok,_} = compile:file(filename:join([DataDir,'a_SeqIn']), [{i,OutDir}]), - ?line 'a_SeqIn' = a_SeqIn:record_name(), + 'a_SeqIn' = a_SeqIn:record_name(), ok. diff --git a/lib/asn1/test/test_partial_incomplete_decode.erl b/lib/asn1/test/test_partial_incomplete_decode.erl index 64f2ce22ae..d809e7c57c 100644 --- a/lib/asn1/test/test_partial_incomplete_decode.erl +++ b/lib/asn1/test/test_partial_incomplete_decode.erl @@ -81,72 +81,72 @@ test_megaco(Config) -> exclusive_decode(Bin,F) -> Mod='MEDIA-GATEWAY-CONTROL', io:format("Encoding message: ~p~n",[F]), - ?line {ok,{_,_,{_,_VsnNo,{MsgMidKey,MsgMid},{MsgMBodyKey,MsgMBody}}}}= + {ok,{_,_,{_,_VsnNo,{MsgMidKey,MsgMid},{MsgMBodyKey,MsgMBody}}}}= Mod:decode_MegacoMessage_exclusive(Bin), - ?line {ok,_} = Mod:decode_part(MsgMidKey,MsgMid), - ?line {ok,_} = Mod:decode_part(MsgMBodyKey,MsgMBody), + {ok,_} = Mod:decode_part(MsgMidKey,MsgMid), + {ok,_} = Mod:decode_part(MsgMBodyKey,MsgMBody), ok. decode_parts('F',PartDecMsg) -> - ?line {fb,{'E',35,{NameE_b,ListBinE_b},false,{NameE_d,BinE_d}}} = PartDecMsg, - ?line {ok,[{'D',3,true}|_]} = 'PartialDecSeq':decode_part(NameE_b,ListBinE_b), - ?line {ok,{'D',3,true}} = 'PartialDecSeq':decode_part(NameE_b, + {fb,{'E',35,{NameE_b,ListBinE_b},false,{NameE_d,BinE_d}}} = PartDecMsg, + {ok,[{'D',3,true}|_]} = 'PartialDecSeq':decode_part(NameE_b,ListBinE_b), + {ok,{'D',3,true}} = 'PartialDecSeq':decode_part(NameE_b, hd(ListBinE_b)), - ?line {ok,{da,[{'A',16,{'D',17,true}}]}} = + {ok,{da,[{'A',16,{'D',17,true}}]}} = 'PartialDecSeq':decode_part(NameE_d,BinE_d), ok; decode_parts('F2',PartDecMsg) -> - ?line {fb,{'E',35,{E_bkey,E_b},false,{da,{E_d_akey,E_d_a}}}} = PartDecMsg, - ?line {ok,[{'D',3,true},{'D',4,false},{'D',5,true},{'D',6,true},{'D',7,false},{'D',8,true},{'D',9,true},{'D',10,false},{'D',11,true},{'D',12,true},{'D',13,false},{'D',14,true}]} = 'PartialDecSeq':decode_part(E_bkey,E_b), - ?line {ok,[{'A',16,{'D',17,true}}]} = 'PartialDecSeq':decode_part(E_d_akey,E_d_a); + {fb,{'E',35,{E_bkey,E_b},false,{da,{E_d_akey,E_d_a}}}} = PartDecMsg, + {ok,[{'D',3,true},{'D',4,false},{'D',5,true},{'D',6,true},{'D',7,false},{'D',8,true},{'D',9,true},{'D',10,false},{'D',11,true},{'D',12,true},{'D',13,false},{'D',14,true}]} = 'PartialDecSeq':decode_part(E_bkey,E_b), + {ok,[{'A',16,{'D',17,true}}]} = 'PartialDecSeq':decode_part(E_d_akey,E_d_a); decode_parts('F3',PartDecMsg) -> - ?line {fb,{'E',10,{E_bkey,E_b},false,{dc,{'E_d_dc',13,true,{E_d_dc_dcckey,E_d_dc_dcc}}}}} = PartDecMsg, - ?line {ok,[{'D',11,true},{'D',12,false}]} = 'PartialDecSeq':decode_part(E_bkey,E_b), - ?line {ok,{'E_d_dc_dcc',14,15}} = 'PartialDecSeq':decode_part(E_d_dc_dcckey,E_d_dc_dcc); + {fb,{'E',10,{E_bkey,E_b},false,{dc,{'E_d_dc',13,true,{E_d_dc_dcckey,E_d_dc_dcc}}}}} = PartDecMsg, + {ok,[{'D',11,true},{'D',12,false}]} = 'PartialDecSeq':decode_part(E_bkey,E_b), + {ok,{'E_d_dc_dcc',14,15}} = 'PartialDecSeq':decode_part(E_d_dc_dcckey,E_d_dc_dcc); decode_parts('D',PartDecMsg) -> - ?line {'D',{NameD_a,BinD_a},true} = PartDecMsg, - ?line {ok,123} = 'PartialDecSeq':decode_part(NameD_a,BinD_a), + {'D',{NameD_a,BinD_a},true} = PartDecMsg, + {ok,123} = 'PartialDecSeq':decode_part(NameD_a,BinD_a), ok; decode_parts('A',PartDecMsg) -> - ?line {'A',12,{c,{'S',true,false}},{b,{NameA_c_b,BinA_c_b}}} = PartDecMsg, - ?line {ok,{'A_c_b',false,false}} = + {'A',12,{c,{'S',true,false}},{b,{NameA_c_b,BinA_c_b}}} = PartDecMsg, + {ok,{'A_c_b',false,false}} = 'PartialDecSeq2':decode_part(NameA_c_b,BinA_c_b), ok; decode_parts('GetRequest',PartDecMsg) -> - ?line {'GetRequest',true,false, + {'GetRequest',true,false, {'AcceptTypes',[html,'plain-text',gif,jpeg], {NameAcceptTypes_others,ListBinAcceptTypes_others}}, "IamfineThankYOu"} = PartDecMsg, - ?line {ok,["hell","othe","reho","peyo","uare","fine"]} = + {ok,["hell","othe","reho","peyo","uare","fine"]} = 'PartialDecMyHTTP':decode_part(NameAcceptTypes_others, ListBinAcceptTypes_others), - ?line {ok,"hell"} = + {ok,"hell"} = 'PartialDecMyHTTP':decode_part(NameAcceptTypes_others, hd(ListBinAcceptTypes_others)), ok; decode_parts('S1_1',PartDecMsg) -> - ?line {'S1',14,{'S2',false,12,{NameS2c,BinS2c}}, + {'S1',14,{'S2',false,12,{NameS2c,BinS2c}}, {_,{NameS1c_a,ListBinS1c_a}},{NameS1d,BinS1d}} = PartDecMsg, - ?line {ok,[{'S3',10,"PrintableString","OCTETSTRING", + {ok,[{'S3',10,"PrintableString","OCTETSTRING", [one,two,three,four]}|_Rest1]} = 'PartialDecSeq3':decode_part(NameS2c,BinS2c), - ?line {ok,[{'S3',10,"PrintableString","OCTETSTRING", + {ok,[{'S3',10,"PrintableString","OCTETSTRING", [one,two,three,four]}|_Rest2]} = 'PartialDecSeq3':decode_part(NameS1c_a,ListBinS1c_a), - ?line {ok,{'S3',10,"PrintableString","OCTETSTRING", + {ok,{'S3',10,"PrintableString","OCTETSTRING", [one,two,three,four]}} = 'PartialDecSeq3':decode_part(NameS1c_a,hd(ListBinS1c_a)), - ?line {ok,[{'Name',"Hans","HCA","Andersen"}|_Rest3]} = + {ok,[{'Name',"Hans","HCA","Andersen"}|_Rest3]} = 'PartialDecSeq3':decode_part(NameS1d,BinS1d), ok; decode_parts('S1_2',PartDecMsg) -> - ?line {'S1',14,{'S2',false,12,_S2c},S1c_b,{NameS1d,BinS1d}} = PartDecMsg, - ?line {b,{'C1_b',11,true, + {'S1',14,{'S2',false,12,_S2c},S1c_b,{NameS1d,BinS1d}} = PartDecMsg, + {b,{'C1_b',11,true, {'S4',{'Name',"Hans","HCA","Andersen"},"MSc"}}}=S1c_b, - ?line {ok,[{'Name',"Hans","HCA","Andersen"}|_Rest3]} = + {ok,[{'Name',"Hans","HCA","Andersen"}|_Rest3]} = 'PartialDecSeq3':decode_part(NameS1d,BinS1d), ok. diff --git a/lib/asn1/test/test_special_decode_performance.erl b/lib/asn1/test/test_special_decode_performance.erl index 6cf7ee2805..55e64b61e0 100644 --- a/lib/asn1/test/test_special_decode_performance.erl +++ b/lib/asn1/test/test_special_decode_performance.erl @@ -27,29 +27,29 @@ go(all) -> {Time_S_s,Time_S_e,Time_S_c}=go(10000,'PartialDecSeq'), {Time_MGC_s,Time_MGC_e,Time_MGC_c}=go(10000,'MEDIA-GATEWAY-CONTROL'), - ?line do_comment({Time_S_s,Time_MGC_s}, + do_comment({Time_S_s,Time_MGC_s}, {Time_S_e,Time_MGC_e}, {Time_S_c,Time_MGC_c}). go(N,Mod) -> {Type,Val} = val(Mod), {ok,B} = Mod:encode(Type, Val), - ?line go(Mod,B,N). + go(Mod,B,N). go(Mod,Bin,N) -> - ?line FsS = get_selective_funcs(Mod), - ?line FsE = get_exclusive_funcs(Mod), - ?line io:format("~nSize of value for module ~p: ~p bytes.~n~n",[Mod,size(Bin)]), - ?line Time_s=go1(selective,Mod,FsS,Bin,N,0), - ?line Time_e=go1(exclusive,Mod,FsE,Bin,N,0), - ?line Time_c=go1(common,Mod,[decode],Bin,N,0), - ?line {Time_s/length(FsS),Time_e/length(FsE),Time_c}. + FsS = get_selective_funcs(Mod), + FsE = get_exclusive_funcs(Mod), + io:format("~nSize of value for module ~p: ~p bytes.~n~n",[Mod,size(Bin)]), + Time_s=go1(selective,Mod,FsS,Bin,N,0), + Time_e=go1(exclusive,Mod,FsE,Bin,N,0), + Time_c=go1(common,Mod,[decode],Bin,N,0), + {Time_s/length(FsS),Time_e/length(FsE),Time_c}. go1(_,_,[],_,_,AccTime) -> - ?line AccTime; + AccTime; %% go1 for common decode go1(common,Mod,_,Bin,N,_) -> - ?line TT=get_top_type(Mod), + TT=get_top_type(Mod), {Time,Result} = timer:tc(fun() -> loop1(Mod, decode, TT, Bin, N) end), case Result of {ok,_R1} -> -- cgit v1.2.3