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
25
-include_lib("test_server/include/test_server.hrl").
27
-record('Opt1',{bool0,
30
bool3 = asn1_NOVALUE}).
32
-record('Opt2',{bool10,
33
bool11 = asn1_NOVALUE,
34
bool12 = asn1_NOVALUE,
37
-record('Opt3',{bool30 = asn1_NOVALUE,
38
bool31 = asn1_NOVALUE,
39
bool32 = asn1_NOVALUE,
40
bool33 = asn1_NOVALUE}).
43
compile(Config,Rules) ->
45
?line DataDir = ?config(data_dir,Config),
46
?line OutDir = ?config(priv_dir,Config),
47
?line true = code:add_patha(?config(priv_dir,Config)),
48
?line ok = asn1ct:compile(DataDir ++ "Opt",[Rules,{outdir,OutDir}]).
54
?line {ok,Bytes11} = asn1_wrapper:encode('Opt','Opt1',#'Opt1'{bool0 = true,
58
?line {ok,{'Opt1',true,true,true,true}} =
59
asn1_wrapper:decode('Opt','Opt1',lists:flatten(Bytes11)),
61
?line {ok,Bytes12} = asn1_wrapper:encode('Opt','Opt1',#'Opt1'{bool0 = true}),
62
?line {ok,{'Opt1',true,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE}} =
63
asn1_wrapper:decode('Opt','Opt1',lists:flatten(Bytes12)),
65
?line {ok,Bytes13} = asn1_wrapper:encode('Opt','Opt1',#'Opt1'{bool0 = true,
67
?line {ok,{'Opt1',true,asn1_NOVALUE,false,asn1_NOVALUE}} =
68
asn1_wrapper:decode('Opt','Opt1',lists:flatten(Bytes13)),
70
?line {ok,Bytes14} = asn1_wrapper:encode('Opt','Opt1',#'Opt1'{bool0 = false,
72
?line {ok,{'Opt1',false,asn1_NOVALUE,asn1_NOVALUE,false}} =
73
asn1_wrapper:decode('Opt','Opt1',lists:flatten(Bytes14)),
78
?line {ok,Bytes21} = asn1_wrapper:encode('Opt','Opt2',#'Opt2'{bool10 = false,
82
?line {ok,{'Opt2',false,false,false,false}} =
83
asn1_wrapper:decode('Opt','Opt2',lists:flatten(Bytes21)),
85
?line {ok,Bytes22} = asn1_wrapper:encode('Opt','Opt2',#'Opt2'{bool10 = true,
87
?line {ok,{'Opt2',true,asn1_NOVALUE,asn1_NOVALUE,false}} =
88
asn1_wrapper:decode('Opt','Opt2',lists:flatten(Bytes22)),
90
?line {ok,Bytes23} = asn1_wrapper:encode('Opt','Opt2',#'Opt2'{bool10 = true,
93
?line {ok,{'Opt2',true,false,asn1_NOVALUE,false}} =
94
asn1_wrapper:decode('Opt','Opt2',lists:flatten(Bytes23)),
96
?line {ok,Bytes24} = asn1_wrapper:encode('Opt','Opt2',#'Opt2'{bool10 = false,
99
?line {ok,{'Opt2',false,asn1_NOVALUE,false,false}} =
100
asn1_wrapper:decode('Opt','Opt2',lists:flatten(Bytes24)),
105
?line {ok,Bytes31} = asn1_wrapper:encode('Opt','Opt3',#'Opt3'{bool30 = false,
109
?line {ok,{'Opt3',false,false,false,false}} =
110
asn1_wrapper:decode('Opt','Opt3',lists:flatten(Bytes31)),
112
?line {ok,Bytes32} = asn1_wrapper:encode('Opt','Opt3',#'Opt3'{}),
113
?line {ok,{'Opt3',asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE}} =
114
asn1_wrapper:decode('Opt','Opt3',lists:flatten(Bytes32)),
116
?line {ok,Bytes33} = asn1_wrapper:encode('Opt','Opt3',#'Opt3'{bool30 = true}),
117
?line {ok,{'Opt3',true,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE}} =
118
asn1_wrapper:decode('Opt','Opt3',lists:flatten(Bytes33)),
120
?line {ok,Bytes34} = asn1_wrapper:encode('Opt','Opt3',#'Opt3'{bool32 = false}),
121
?line {ok,{'Opt3',asn1_NOVALUE,asn1_NOVALUE,false,asn1_NOVALUE}} =
122
asn1_wrapper:decode('Opt','Opt3',lists:flatten(Bytes34)),
124
?line {ok,Bytes35} = asn1_wrapper:encode('Opt','Opt3',#'Opt3'{bool33 = false}),
125
?line {ok,{'Opt3',asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,false}} =
126
asn1_wrapper:decode('Opt','Opt3',lists:flatten(Bytes35)),