4
%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
6
%% The contents of this file are subject to the Erlang Public License,
7
%% Version 1.1, (the "License"); you may not use this file except in
8
%% compliance with the License. You should have received a copy of the
9
%% Erlang Public License along with this software. If not, it can be
10
%% retrieved online at http://www.erlang.org/.
12
%% Software distributed under the License is distributed on an "AS IS"
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
%% the License for the specific language governing rights and limitations
21
-module(testParameterizedInfObj).
23
-export([compile/3,main/1,ranap/1]).
25
-include_lib("test_server/include/test_server.hrl").
27
-record('AllocationOrRetentionPriority',{priorityLevel,iE_Extensions}).
28
-record('ProtocolExtensionField',{id,criticality,extensionValue}).
30
-record('InitiatingMessage',{procedureCode,criticality,value}).
31
-record('Iu-ReleaseCommand',{protocolIEs,protocolExtensions}).
34
compile(Config,Rules,Options) ->
36
?line DataDir = ?config(data_dir,Config),
37
?line OutDir = ?config(priv_dir,Config),
38
?line true = code:add_patha(?config(priv_dir,Config)),
40
?line ok = asn1ct:compile(DataDir ++ "Param",[Rules,{outdir,OutDir}]++Options).
41
% ?line ok = asn1ct:compile(DataDir ++ "RANAP-CommonDataTypes",[Rules,{outdir,OutDir}]++Options).
45
PERVal = #'AllocationOrRetentionPriority'
46
{priorityLevel = true,
48
[#'ProtocolExtensionField'{id=14,
50
extensionValue=open_type(Erule,[0])},
51
#'ProtocolExtensionField'{id=2,
53
extensionValue=open_type(Erule,[1])}]},
54
BERVal = #'AllocationOrRetentionPriority'
55
{priorityLevel = true,
57
[#'ProtocolExtensionField'{id=14,
59
extensionValue=[2,1,0]},
60
#'ProtocolExtensionField'{id=2,
62
extensionValue=[2,1,1]}]},
64
case asn1_wrapper:erule(Erule) of
66
asn1_wrapper:encode('Param','AllocationOrRetentionPriority',
69
asn1_wrapper:encode('Param','AllocationOrRetentionPriority',
73
?line {ok,{'AllocationOrRetentionPriority',true,[_R1,_R2]}} =
74
asn1_wrapper:decode('Param','AllocationOrRetentionPriority',Bytes1),
76
%% test code for OTP-4242, ValueFromObject
78
case asn1_wrapper:erule(Erule) of
80
?line {ok,_Val3} = asn1_wrapper:decode('Param','OS1',[4,2,1,2]),
81
?line {error,_Reason1} =
82
asn1_wrapper:decode('Param','OS1',[4,4,1,2,3,4]),
83
?line {error,_Reason2} =
84
asn1_wrapper:decode('Param','OS2',[4,4,1,2,3,4]),
85
?line {ok,_Val4} = asn1_wrapper:decode('Param','OS1',[4,2,1,2]);
88
asn1_wrapper:encode('Param','OS1',[1,2]),
90
asn1_wrapper:decode('Param','OS1',Bytes3),
91
?line {error,_Reason3} =
92
asn1_wrapper:encode('Param','OS1',[1,2,3,4])
99
?line PIEVal2 = [{'ProtocolIE-Field',4,ignore,{'Cause',{radioNetwork,'rab-pre-empted'}}}],
101
#'InitiatingMessage'{procedureCode=1,
103
value=#'Iu-ReleaseCommand'{protocolIEs=PIEVal2,
104
protocolExtensions=asn1_NOVALUE}},
106
?line {ok,Bytes2} = asn1_wrapper:encode('RANAP','InitiatingMessage',Val2),
107
?line {ok,_Ret2} = asn1_wrapper:decode('RANAP','InitiatingMessage',Bytes2),
111
open_type(uper_bin,Val) when is_list(Val) ->