4
%% Copyright Ericsson AB 1997-2009. 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
20
-module(testSeqOfCho).
25
-include("test_server.hrl").
27
-record('SeqChoDef',{bool1, int1, seq1 = asn1_DEFAULT}).
28
-record('SeqChoOpt',{bool1, int1, seq1 = asn1_NOVALUE}).
29
-record('SeqChoEmbDef',{bool1, int1, seq1 = asn1_DEFAULT}).
30
-record('SeqChoEmbOpt',{bool1, int1, seq1 = asn1_NOVALUE}).
31
-record('SeqOfChoEmbDef_SEQOF',{bool1, int1, seq1 = asn1_DEFAULT}).
32
-record('SeqOfChoEmbOpt_SEQOF',{bool1, int1, seq1 = asn1_NOVALUE}).
36
compile(Config,Rules,Options) ->
38
?line DataDir = ?config(data_dir,Config),
39
?line OutDir = ?config(priv_dir,Config),
40
?line true = code:add_patha(?config(priv_dir,Config)),
41
?line ok = asn1ct:compile(DataDir ++ "SeqOfCho",[Rules,{outdir,OutDir}]++Options).
48
asn1_wrapper:encode('SeqOfCho','SeqChoDef',#'SeqChoDef'{bool1 = true,
50
?line {ok,{'SeqChoDef',true,17,[]}} =
51
asn1_wrapper:decode('SeqOfCho','SeqChoDef',lists:flatten(Bytes11)),
55
asn1_wrapper:encode('SeqOfCho','SeqChoDef',#'SeqChoDef'{bool1 = true,
57
seq1 = [{boolIn,true},
59
?line {ok,{'SeqChoDef',true,17,[{boolIn,true},{intIn,25}]}} =
60
asn1_wrapper:decode('SeqOfCho','SeqChoDef',lists:flatten(Bytes12)),
65
asn1_wrapper:encode('SeqOfCho','SeqChoOpt',#'SeqChoOpt'{bool1 = true,
67
?line {ok,{'SeqChoOpt',true,17,asn1_NOVALUE}} =
68
asn1_wrapper:decode('SeqOfCho','SeqChoOpt',lists:flatten(Bytes15)),
72
asn1_wrapper:encode('SeqOfCho','SeqChoOpt',#'SeqChoOpt'{bool1 = true,
74
seq1 = [{boolIn,true},
76
?line {ok,{'SeqChoOpt',true,17,[{boolIn,true},{intIn,25}]}} =
77
asn1_wrapper:decode('SeqOfCho','SeqChoOpt',lists:flatten(Bytes16)),
84
asn1_wrapper:encode('SeqOfCho','SeqChoEmbDef',#'SeqChoEmbDef'{bool1 = true,
86
?line {ok,{'SeqChoEmbDef',true,17,[]}} =
87
asn1_wrapper:decode('SeqOfCho','SeqChoEmbDef',lists:flatten(Bytes21)),
91
asn1_wrapper:encode('SeqOfCho','SeqChoEmbDef',#'SeqChoEmbDef'{bool1 = true,
93
seq1 = [{boolIn,true},
95
?line {ok,{'SeqChoEmbDef',true,17,[{boolIn,true},{intIn,25}]}} =
96
asn1_wrapper:decode('SeqOfCho','SeqChoEmbDef',lists:flatten(Bytes22)),
101
asn1_wrapper:encode('SeqOfCho','SeqChoEmbOpt',#'SeqChoEmbOpt'{bool1 = true,
103
?line {ok,{'SeqChoEmbOpt',true,17,asn1_NOVALUE}} =
104
asn1_wrapper:decode('SeqOfCho','SeqChoEmbOpt',lists:flatten(Bytes25)),
108
asn1_wrapper:encode('SeqOfCho','SeqChoEmbOpt',#'SeqChoEmbOpt'{bool1 = true,
110
seq1 = [{boolIn,true},
112
?line {ok,{'SeqChoEmbOpt',true,17,[{boolIn,true},{intIn,25}]}} =
113
asn1_wrapper:decode('SeqOfCho','SeqChoEmbOpt',lists:flatten(Bytes26)),
121
asn1_wrapper:encode('SeqOfCho','SeqOfChoEmbDef',[#'SeqOfChoEmbDef_SEQOF'{bool1 = true,
123
?line {ok,[{'SeqOfChoEmbDef_SEQOF',true,17,[]}]} =
124
asn1_wrapper:decode('SeqOfCho','SeqOfChoEmbDef',lists:flatten(Bytes31)),
128
asn1_wrapper:encode('SeqOfCho','SeqOfChoEmbDef',
129
[#'SeqOfChoEmbDef_SEQOF'{bool1 = true,
131
seq1 = [{boolIn,true},
133
?line {ok,[{'SeqOfChoEmbDef_SEQOF',true,17,[{boolIn,true},{intIn,25}]}]} =
134
asn1_wrapper:decode('SeqOfCho','SeqOfChoEmbDef',lists:flatten(Bytes32)),
139
asn1_wrapper:encode('SeqOfCho','SeqOfChoEmbOpt',[#'SeqOfChoEmbOpt_SEQOF'{bool1 = true,
141
?line {ok,[{'SeqOfChoEmbOpt_SEQOF',true,17,asn1_NOVALUE}]} =
142
asn1_wrapper:decode('SeqOfCho','SeqOfChoEmbOpt',lists:flatten(Bytes35)),
146
asn1_wrapper:encode('SeqOfCho','SeqOfChoEmbOpt',
147
[#'SeqOfChoEmbOpt_SEQOF'{bool1 = true,
149
seq1 = [{boolIn,true},
151
?line {ok,[{'SeqOfChoEmbOpt_SEQOF',true,17,[{boolIn,true},{intIn,25}]}]} =
152
asn1_wrapper:decode('SeqOfCho','SeqOfChoEmbOpt',lists:flatten(Bytes36)),