diff options
author | Björn Gustavsson <[email protected]> | 2013-09-10 07:32:50 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-09-18 10:22:31 +0200 |
commit | 85354c27e11e109efb94bd4f867831a295c1a1cf (patch) | |
tree | 7c3e4d2b1bc5389935a8d11916115f679979a2a9 /lib/asn1/test/asn1_test_lib.erl | |
parent | 49fbd0c946d7846b981e025b96a25e78c7764853 (diff) | |
download | otp-85354c27e11e109efb94bd4f867831a295c1a1cf.tar.gz otp-85354c27e11e109efb94bd4f867831a295c1a1cf.tar.bz2 otp-85354c27e11e109efb94bd4f867831a295c1a1cf.zip |
Move out specific tests from asn1_test_lib
asn1_test_lib is supposed to be a general-purpose helper module for
test cases. Move all specific test cases into asn1_SUITE.
Diffstat (limited to 'lib/asn1/test/asn1_test_lib.erl')
-rw-r--r-- | lib/asn1/test/asn1_test_lib.erl | 128 |
1 files changed, 0 insertions, 128 deletions
diff --git a/lib/asn1/test/asn1_test_lib.erl b/lib/asn1/test/asn1_test_lib.erl index 5bdd0a4637..530d2a38a1 100644 --- a/lib/asn1/test/asn1_test_lib.erl +++ b/lib/asn1/test/asn1_test_lib.erl @@ -24,9 +24,6 @@ -export([compile_erlang/3]). -export([hex_to_bin/1]). --export([ticket_7407_compile/2,ticket_7407_code/1, ticket_7678/2, - ticket_7708/2, ticket_7763/1, ticket_7876/3]). - -include_lib("test_server/include/test_server.hrl"). compile(File, Config, Options) -> compile_all([File], Config, Options). @@ -64,128 +61,3 @@ hex_to_bin(S) -> hex2num(C) when $0 =< C, C =< $9 -> C - $0; hex2num(C) when $A =< C, C =< $F -> C - $A + 10; hex2num(C) when $a =< C, C =< $f -> C - $a + 10. - -ticket_7407_compile(Config,Option) -> - - ?line DataDir = ?config(data_dir,Config), - ?line OutDir = ?config(priv_dir,Config), - - ?line ok = asn1ct:compile(DataDir ++ "EUTRA-extract-7407", - [uper, {outdir,OutDir}]++Option). - -ticket_7708(Config,Option) -> - ?line DataDir = ?config(data_dir,Config), - ?line OutDir = ?config(priv_dir,Config), - - ?line ok = asn1ct:compile(DataDir ++ "EUTRA-extract-55", - [uper, {outdir,OutDir}]++Option). - - -ticket_7407_code(FinalPadding) -> - Msg1 = {Type1,_} = eutra1(msg), - ?line {ok,B1} = 'EUTRA-extract-7407':encode(Type1,Msg1), - ?line B1 = eutra1(result,FinalPadding), - - Msg2 = {Type2,_} = eutra2(msg), - ?line {ok,B2} = 'EUTRA-extract-7407':encode(Type2,Msg2), - ?line B2 = eutra2(result,FinalPadding), - ok. - -eutra1(msg) -> - {'BCCH-BCH-Message',{'MasterInformationBlock',[0,1,0,1],[1,0,1,0],{'PHICH-Configuration',short,ffs},[1,0,1,0,0,0,0,0]}}. -eutra1(result,true) -> - <<90,80,0>>; -eutra1(result,false) -> - <<90,80,0:1>>. - -eutra2(msg) -> - {'BCCH-DL-SCH-Message', - {c1, - {systemInformation1, - {'SystemInformationBlockType1', - {'SystemInformationBlockType1_cellAccessRelatedInformation', - [{'SystemInformationBlockType1_cellAccessRelatedInformation_plmn-IdentityList_SEQOF',{'PLMN-Identity'},true}, - {'SystemInformationBlockType1_cellAccessRelatedInformation_plmn-IdentityList_SEQOF',{'PLMN-Identity'},false}, - {'SystemInformationBlockType1_cellAccessRelatedInformation_plmn-IdentityList_SEQOF',{'PLMN-Identity'},true}], - {'TrackingAreaCode'}, - {'CellIdentity'}, - false, - true, - true, - true - }, - {'SystemInformationBlockType1_cellSelectionInfo',-50}, - 24, - [{'SystemInformationBlockType1_schedulinInformation_SEQOF', - {'SystemInformationBlockType1_schedulinInformation_SEQOF_si-MessageType'}, - ms320, - {'SystemInformationBlockType1_schedulinInformation_SEQOF_sib-MappingInfo'}}], - 0 - } - } - } - }. -eutra2(result,true) -> -%% 55 5C A5 E0 - <<85,92,165,224>>; -eutra2(result,false) -> - <<85,92,165,14:4>>. - - - -ticket_7678(Config, Option) -> - ?line DataDir = ?config(data_dir,Config), - ?line OutDir = ?config(priv_dir,Config), - - ?line ok = asn1ct:compile(DataDir ++ "UPERDefault", - [uper, {outdir,OutDir}]++Option), - - ?line Val = 'UPERDefault':seq(), - ?line {ok,<<0,6,0>>} = 'UPERDefault':encode('Seq',Val), - ?line {ok,Val} = 'UPERDefault':decode('Seq',<<0,6,0>>), - ok. - - -ticket_7763(Config) -> - ?line DataDir = ?config(data_dir,Config), - ?line OutDir = ?config(priv_dir,Config), - - ?line ok = asn1ct:compile(DataDir ++ "EUTRA-extract-55", - [uper, {outdir,OutDir}]), - Val = {'Seq',15,lists:duplicate(8,0),[0],lists:duplicate(28,0),15,true}, - ?line {ok,Bin} = 'EUTRA-extract-55':encode('Seq',Val), - - ?line ok = asn1ct:compile(DataDir ++ "EUTRA-extract-55", - [uper,compact_bit_string,{outdir,OutDir}]), - CompactVal = {'Seq',15,{0,<<0>>},{7,<<0>>},{4,<<0,0,0,0>>},15,true}, - {ok,CompactBin} = 'EUTRA-extract-55':encode('Seq',CompactVal), - - ?line Bin = CompactBin, - - io:format("CompactBin:~n~p~nBin:~n~p~nCompactBin == Bin is ~p~n",[CompactBin,Bin,CompactBin == Bin]). - - -ticket_7876(Config,Erule,Options) -> - ?line DataDir = ?config(data_dir,Config), - ?line OutDir = ?config(priv_dir,Config), - - ?line ok = asn1ct:compile(DataDir ++ "S1AP-CommonDataTypes", - [Erule,{outdir,OutDir}|Options]), - ?line ok = asn1ct:compile(DataDir ++ "S1AP-Constants", - [Erule,{outdir,OutDir}|Options]), -?line ok = asn1ct:compile(DataDir ++ "S1AP-Containers", - [Erule,{outdir,OutDir}|Options]), -?line ok = asn1ct:compile(DataDir ++ "S1AP-IEs", - [Erule,{outdir,OutDir}|Options]), -?line ok = asn1ct:compile(DataDir ++ "S1AP-PDU-Contents", - [Erule,{outdir,OutDir}|Options]), -?line ok = asn1ct:compile(DataDir ++ "S1AP-PDU-Descriptions", - [Erule,{outdir,OutDir}|Options]), - - ticket_7876_encdec(Erule), - ok. - -ticket_7876_encdec(per) -> - ?line {ok,{initiatingMessage,_}} = 'S1AP-PDU-Descriptions':decode('S1AP-PDU', [0,2,64,49,0,0,5,0,0,0,4,128,106,56,197,0,8,0,3,64,2,134,0,100,64,8,0,66,240,153,0,7,192,16,0,67,64,6,0,66,240,153,70,1,0,107,64,5,0,0,0,0,0]); -ticket_7876_encdec(_) -> - ?line {ok,{initiatingMessage,_}} = 'S1AP-PDU-Descriptions':decode('S1AP-PDU', <<0,2,64,49,0,0,5,0,0,0,4,128,106,56,197,0,8,0,3,64,2,134,0,100,64,8,0,66,240,153,0,7,192,16,0,67,64,6,0,66,240,153,70,1,0,107,64,5,0,0,0,0,0>>). |