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(testSeqExternal).
22
-include("External.hrl").
26
-include_lib("test_server/include/test_server.hrl").
29
-record('SeqXSet1',{set, bool, int}).
30
-record('SeqXSet2',{bool, set, int}).
31
-record('SeqXSet3',{bool, int, set}).
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 ++ "SeqExternal",
43
[Rules,{outdir,OutDir}]++Options).
50
asn1_wrapper:encode('SeqExternal','XNTNT',#'XSeqNT'{bool = true, os = "kalle"}),
51
?line {ok,{'XSeqNT',[107,97,108,108,101],true}} =
52
asn1_wrapper:decode('SeqExternal','XNTNT',lists:flatten(Bytes11)),
55
asn1_wrapper:encode('SeqExternal','XImpNT',#'XSeqNT'{bool = true, os = "kalle"}),
56
?line {ok,{'XSeqNT',[107,97,108,108,101],true}} =
57
asn1_wrapper:decode('SeqExternal','XImpNT',lists:flatten(Bytes12)),
60
asn1_wrapper:encode('SeqExternal','XExpNT',#'XSeqNT'{bool = true, os = "kalle"}),
61
?line {ok,{'XSeqNT',[107,97,108,108,101],true}} =
62
asn1_wrapper:decode('SeqExternal','XExpNT',lists:flatten(Bytes13)),
67
asn1_wrapper:encode('SeqExternal','XNTImp',#'XSeqImp'{bool = true, os = "kalle"}),
68
?line {ok,{'XSeqImp',[107,97,108,108,101],true}} =
69
asn1_wrapper:decode('SeqExternal','XNTImp',lists:flatten(Bytes21)),
72
asn1_wrapper:encode('SeqExternal','XImpImp',#'XSeqImp'{bool = true, os = "kalle"}),
73
?line {ok,{'XSeqImp',[107,97,108,108,101],true}} =
74
asn1_wrapper:decode('SeqExternal','XImpImp',lists:flatten(Bytes22)),
77
asn1_wrapper:encode('SeqExternal','XExpImp',#'XSeqImp'{bool = true, os = "kalle"}),
78
?line {ok,{'XSeqImp',[107,97,108,108,101],true}} =
79
asn1_wrapper:decode('SeqExternal','XExpImp',lists:flatten(Bytes23)),
84
asn1_wrapper:encode('SeqExternal','XNTExp',#'XSeqExp'{bool = true, os = "kalle"}),
85
?line {ok,{'XSeqExp',[107,97,108,108,101],true}} =
86
asn1_wrapper:decode('SeqExternal','XNTExp',lists:flatten(Bytes31)),
89
asn1_wrapper:encode('SeqExternal','XImpExp',#'XSeqExp'{bool = true, os = "kalle"}),
90
?line {ok,{'XSeqExp',[107,97,108,108,101],true}} =
91
asn1_wrapper:decode('SeqExternal','XImpExp',lists:flatten(Bytes32)),
94
asn1_wrapper:encode('SeqExternal','XExpExp',#'XSeqExp'{bool = true, os = "kalle"}),
95
?line {ok,{'XSeqExp',[107,97,108,108,101],true}} =
96
asn1_wrapper:decode('SeqExternal','XExpExp',lists:flatten(Bytes33)),
101
asn1_wrapper:encode('SeqExternal','SeqXSet1',
102
#'SeqXSet1'{bool = true,
104
set = #'XSet1'{bool1 = true,
106
set1 = #'XSetIn'{boolIn = false,
108
?line {ok,{'SeqXSet1',{'XSet1',true,77,{'XSetIn',false,88}},true,66}} =
109
asn1_wrapper:decode('SeqExternal','SeqXSet1',lists:flatten(Bytes41)),
114
asn1_wrapper:encode('SeqExternal','SeqXSet2',
115
#'SeqXSet2'{bool = true,
117
set = #'XSet1'{bool1 = true,
119
set1 = #'XSetIn'{boolIn = false,
121
?line {ok,{'SeqXSet2',true,{'XSet1',true,77,{'XSetIn',false,88}},66}} =
122
asn1_wrapper:decode('SeqExternal','SeqXSet2',lists:flatten(Bytes42)),
125
asn1_wrapper:encode('SeqExternal','SeqXSet3',
126
#'SeqXSet3'{bool = true,
128
set = #'XSet1'{bool1 = true,
130
set1 = #'XSetIn'{boolIn = false,
132
?line {ok,{'SeqXSet3',true,66,{'XSet1',true,77,{'XSetIn',false,88}}}} =
133
asn1_wrapper:decode('SeqExternal','SeqXSet3',lists:flatten(Bytes43)),