4
%% Copyright Ericsson AB 1997-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
20
-module(testSeqDefault).
22
-include("External.hrl").
26
-include_lib("test_server/include/test_server.hrl").
28
-record('SeqDef1',{bool1 = asn1_DEFAULT, int1, seq1 = asn1_DEFAULT}).
29
-record('SeqDef1Imp',{bool1 = asn1_DEFAULT, int1, seq1 = asn1_DEFAULT}).
30
-record('SeqDef1Exp',{bool1 = asn1_DEFAULT, int1, seq1 = asn1_DEFAULT}).
31
-record('SeqDef2',{seq2 = asn1_DEFAULT, bool2 = asn1_DEFAULT, int2}).
32
-record('SeqDef2Imp',{seq2 = asn1_DEFAULT, bool2 = asn1_DEFAULT, int2}).
33
-record('SeqDef2Exp',{seq2 = asn1_DEFAULT, bool2, int2}).
34
-record('SeqDef3',{bool3 = asn1_DEFAULT, seq3 = asn1_DEFAULT, int3 = asn1_DEFAULT}).
35
-record('SeqDef3Imp',{bool3 = asn1_DEFAULT, seq3 = asn1_DEFAULT, int3 = asn1_DEFAULT}).
36
-record('SeqDef3Exp',{bool3 = asn1_DEFAULT, seq3 = asn1_DEFAULT, int3 = asn1_DEFAULT}).
37
-record('SeqIn',{boolIn, intIn}).
40
compile(Config,Rules,Options) ->
42
?line DataDir = ?config(data_dir,Config),
43
?line OutDir = ?config(priv_dir,Config),
44
?line true = code:add_patha(?config(priv_dir,Config)),
45
?line ok = asn1ct:compile(DataDir ++ "SeqDefault",[Rules,{outdir,OutDir}]++Options).
52
asn1_wrapper:encode('SeqDefault','SeqDef1',#'SeqDef1'{bool1 = true,
54
seq1 = #'SeqIn'{boolIn = true,
56
?line {ok,{'SeqDef1',true,15,{'SeqIn',true,66}}} =
57
asn1_wrapper:decode('SeqDefault','SeqDef1',lists:flatten(Bytes11)),
60
?line {ok,Bytes12} = asn1_wrapper:encode('SeqDefault','SeqDef1',#'SeqDef1'{int1 = 15}),
61
?line {ok,{'SeqDef1',true,15,{'SeqIn',asn1_NOVALUE,12}}} =
62
asn1_wrapper:decode('SeqDefault','SeqDef1',lists:flatten(Bytes12)),
66
asn1_wrapper:encode('SeqDefault','SeqDef2',#'SeqDef2'{bool2 = true,
68
seq2 = #'SeqIn'{boolIn = true,
70
?line {ok,{'SeqDef2',{'SeqIn',true,66},true,15}} =
71
asn1_wrapper:decode('SeqDefault','SeqDef2',lists:flatten(Bytes21)),
74
?line {ok,Bytes22} = asn1_wrapper:encode('SeqDefault','SeqDef2',#'SeqDef2'{int2 = 15}),
75
?line {ok,{'SeqDef2',{'SeqIn',asn1_NOVALUE,12},true,15}} =
76
asn1_wrapper:decode('SeqDefault','SeqDef2',lists:flatten(Bytes22)),
81
asn1_wrapper:encode('SeqDefault','SeqDef3',#'SeqDef3'{bool3 = true,
83
seq3 = #'SeqIn'{boolIn = true,
85
?line {ok,{'SeqDef3',true,{'SeqIn',true,66},15}} =
86
asn1_wrapper:decode('SeqDefault','SeqDef3',lists:flatten(Bytes31)),
89
?line {ok,Bytes32} = asn1_wrapper:encode('SeqDefault','SeqDef3',#'SeqDef3'{int3 = 15}),
90
?line {ok,{'SeqDef3',true,{'SeqIn',asn1_NOVALUE,12},15}} =
91
asn1_wrapper:decode('SeqDefault','SeqDef3',lists:flatten(Bytes32)),
98
asn1_wrapper:encode('SeqDefault','SeqDef1Imp',#'SeqDef1Imp'{bool1 = true,
100
seq1 = #'SeqIn'{boolIn = true,
102
?line {ok,{'SeqDef1Imp',true,15,{'SeqIn',true,66}}} =
103
asn1_wrapper:decode('SeqDefault','SeqDef1Imp',lists:flatten(Bytes41)),
106
?line {ok,Bytes42} = asn1_wrapper:encode('SeqDefault','SeqDef1Imp',#'SeqDef1Imp'{int1 = 15}),
107
?line {ok,{'SeqDef1Imp',true,15,{'SeqIn',asn1_NOVALUE,12}}} =
108
asn1_wrapper:decode('SeqDefault','SeqDef1Imp',lists:flatten(Bytes42)),
112
asn1_wrapper:encode('SeqDefault','SeqDef2Imp',#'SeqDef2Imp'{bool2 = true,
114
seq2 = #'SeqIn'{boolIn = true,
116
?line {ok,{'SeqDef2Imp',{'SeqIn',true,66},true,15}} =
117
asn1_wrapper:decode('SeqDefault','SeqDef2Imp',lists:flatten(Bytes51)),
120
?line {ok,Bytes52} = asn1_wrapper:encode('SeqDefault','SeqDef2Imp',#'SeqDef2Imp'{int2 = 15}),
121
?line {ok,{'SeqDef2Imp',{'SeqIn',asn1_NOVALUE,12},true,15}} =
122
asn1_wrapper:decode('SeqDefault','SeqDef2Imp',lists:flatten(Bytes52)),
127
asn1_wrapper:encode('SeqDefault','SeqDef3Imp',#'SeqDef3Imp'{bool3 = true,
129
seq3 = #'SeqIn'{boolIn = true,
131
?line {ok,{'SeqDef3Imp',true,{'SeqIn',true,66},15}} =
132
asn1_wrapper:decode('SeqDefault','SeqDef3Imp',lists:flatten(Bytes61)),
135
?line {ok,Bytes62} = asn1_wrapper:encode('SeqDefault','SeqDef3Imp',#'SeqDef3Imp'{int3 = 15}),
136
?line {ok,{'SeqDef3Imp',true,{'SeqIn',asn1_NOVALUE,12},15}} =
137
asn1_wrapper:decode('SeqDefault','SeqDef3Imp',lists:flatten(Bytes62)),
145
asn1_wrapper:encode('SeqDefault','SeqDef1Exp',#'SeqDef1Exp'{bool1 = true,
147
seq1 = #'SeqIn'{boolIn = true,
149
?line {ok,{'SeqDef1Exp',true,15,{'SeqIn',true,66}}} =
150
asn1_wrapper:decode('SeqDefault','SeqDef1Exp',lists:flatten(Bytes71)),
153
?line {ok,Bytes72} = asn1_wrapper:encode('SeqDefault','SeqDef1Exp',#'SeqDef1Exp'{int1 = 15}),
154
?line {ok,{'SeqDef1Exp',true,15,{'SeqIn',asn1_NOVALUE,12}}} =
155
asn1_wrapper:decode('SeqDefault','SeqDef1Exp',lists:flatten(Bytes72)),
159
asn1_wrapper:encode('SeqDefault','SeqDef2Exp',#'SeqDef2Exp'{bool2 = true,
161
seq2 = #'SeqIn'{boolIn = true,
163
?line {ok,{'SeqDef2Exp',{'SeqIn',true,66},true,15}} =
164
asn1_wrapper:decode('SeqDefault','SeqDef2Exp',lists:flatten(Bytes81)),
167
?line {ok,Bytes82} = asn1_wrapper:encode('SeqDefault','SeqDef2Exp',#'SeqDef2Exp'{int2 = 15,
169
?line {ok,{'SeqDef2Exp',{'SeqIn',asn1_NOVALUE,12},true,15}} =
170
asn1_wrapper:decode('SeqDefault','SeqDef2Exp',lists:flatten(Bytes82)),
175
asn1_wrapper:encode('SeqDefault','SeqDef3Exp',#'SeqDef3Exp'{bool3 = true,
177
seq3 = #'SeqIn'{boolIn = true,
179
?line {ok,{'SeqDef3Exp',true,{'SeqIn',true,66},15}} =
180
asn1_wrapper:decode('SeqDefault','SeqDef3Exp',lists:flatten(Bytes91)),
183
?line {ok,Bytes92} = asn1_wrapper:encode('SeqDefault','SeqDef3Exp',#'SeqDef3Exp'{int3 = 15}),
184
?line {ok,{'SeqDef3Exp',true,{'SeqIn',asn1_NOVALUE,12},15}} =
185
asn1_wrapper:decode('SeqDefault','SeqDef3Exp',lists:flatten(Bytes92)),