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(testSetExternal).
22
-include("External.hrl").
26
-include("test_server.hrl").
29
-record('SetXSeq1',{seq, bool, int}).
30
-record('SetXSeq2',{bool, seq, int}).
31
-record('SetXSeq3',{bool, int, seq}).
32
%-record('NT',{os, bool}).
33
%-record('Imp',{os, bool}).
34
%-record('Exp',{os, bool}).
37
compile(Config,Rules,Options) ->
39
?line DataDir = ?config(data_dir,Config),
40
?line OutDir = ?config(priv_dir,Config),
41
?line true = code:add_patha(?config(priv_dir,Config)),
42
?line ok = asn1ct:compile(DataDir ++ "SetExternal",
43
[Rules,{outdir,OutDir}]++Options).
50
asn1_wrapper:encode('SetExternal','XNTNT',#'XSetNT'{bool = true, os = "kalle"}),
51
?line {ok,{'XSetNT',[107,97,108,108,101],true}} =
52
asn1_wrapper:decode('SetExternal','XNTNT',lists:flatten(Bytes11)),
55
asn1_wrapper:encode('SetExternal','XImpNT',#'XSetNT'{bool = true, os = "kalle"}),
56
?line {ok,{'XSetNT',[107,97,108,108,101],true}} =
57
asn1_wrapper:decode('SetExternal','XImpNT',lists:flatten(Bytes12)),
60
asn1_wrapper:encode('SetExternal','XExpNT',#'XSetNT'{bool = true, os = "kalle"}),
61
?line {ok,{'XSetNT',[107,97,108,108,101],true}} =
62
asn1_wrapper:decode('SetExternal','XExpNT',lists:flatten(Bytes13)),
67
asn1_wrapper:encode('SetExternal','XNTImp',#'XSetImp'{bool = true, os = "kalle"}),
68
?line {ok,{'XSetImp',[107,97,108,108,101],true}} =
69
asn1_wrapper:decode('SetExternal','XNTImp',lists:flatten(Bytes21)),
72
asn1_wrapper:encode('SetExternal','XImpImp',#'XSetImp'{bool = true, os = "kalle"}),
73
?line {ok,{'XSetImp',[107,97,108,108,101],true}} =
74
asn1_wrapper:decode('SetExternal','XImpImp',lists:flatten(Bytes22)),
77
asn1_wrapper:encode('SetExternal','XExpImp',#'XSetImp'{bool = true, os = "kalle"}),
78
?line {ok,{'XSetImp',[107,97,108,108,101],true}} =
79
asn1_wrapper:decode('SetExternal','XExpImp',lists:flatten(Bytes23)),
84
asn1_wrapper:encode('SetExternal','XNTExp',#'XSetExp'{bool = true, os = "kalle"}),
85
?line {ok,{'XSetExp',[107,97,108,108,101],true}} =
86
asn1_wrapper:decode('SetExternal','XNTExp',lists:flatten(Bytes31)),
89
asn1_wrapper:encode('SetExternal','XImpExp',#'XSetExp'{bool = true, os = "kalle"}),
90
?line {ok,{'XSetExp',[107,97,108,108,101],true}} =
91
asn1_wrapper:decode('SetExternal','XImpExp',lists:flatten(Bytes32)),
94
asn1_wrapper:encode('SetExternal','XExpExp',#'XSetExp'{bool = true, os = "kalle"}),
95
?line {ok,{'XSetExp',[107,97,108,108,101],true}} =
96
asn1_wrapper:decode('SetExternal','XExpExp',lists:flatten(Bytes33)),
101
asn1_wrapper:encode('SetExternal','SetXSeq1',
102
#'SetXSeq1'{bool = true,
104
seq = #'XSeq1'{bool1 = true,
106
seq1 = #'XSeqIn'{boolIn = false,
108
?line {ok,{'SetXSeq1',{'XSeq1',true,77,{'XSeqIn',false,88}},true,66}} =
109
asn1_wrapper:decode('SetExternal','SetXSeq1',lists:flatten(Bytes41)),
114
asn1_wrapper:encode('SetExternal','SetXSeq2',
115
#'SetXSeq2'{bool = true,
117
seq = #'XSeq1'{bool1 = true,
119
seq1 = #'XSeqIn'{boolIn = false,
121
?line {ok,{'SetXSeq2',true,{'XSeq1',true,77,{'XSeqIn',false,88}},66}} =
122
asn1_wrapper:decode('SetExternal','SetXSeq2',lists:flatten(Bytes42)),
125
asn1_wrapper:encode('SetExternal','SetXSeq3',
126
#'SetXSeq3'{bool = true,
128
seq = #'XSeq1'{bool1 = true,
130
seq1 = #'XSeqIn'{boolIn = false,
132
?line {ok,{'SetXSeq3',true,66,{'XSeq1',true,77,{'XSeqIn',false,88}}}} =
133
asn1_wrapper:decode('SetExternal','SetXSeq3',lists:flatten(Bytes43)),