~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/asn1/test/testSeqOfTag.erl

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%
 
2
%% %CopyrightBegin%
 
3
%%
 
4
%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
 
5
%%
 
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/.
 
11
%%
 
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
 
15
%% under the License.
 
16
%%
 
17
%% %CopyrightEnd%
 
18
%%
 
19
%%
 
20
-module(testSeqOfTag).
 
21
 
 
22
 
 
23
-export([compile/3]).
 
24
-export([main/1]).
 
25
 
 
26
-include_lib("test_server/include/test_server.hrl").
 
27
-include("External.hrl").
 
28
 
 
29
 
 
30
-record('SeqTagNt',{nt}).
 
31
-record('SeqTagNtI',{imp}).
 
32
-record('SeqTagNtE',{exp}).
 
33
-record('SeqTagI',{nt}).
 
34
-record('SeqTagII',{imp}).
 
35
-record('SeqTagIE',{exp}).
 
36
-record('SeqTagE',{nt}).
 
37
-record('SeqTagEI',{imp}).
 
38
-record('SeqTagEE',{exp}).
 
39
-record('SeqTagXNt',{xnt}).
 
40
-record('SeqTagXI',{ximp}).
 
41
-record('SeqTagXE',{xexp}).
 
42
-record('SeqTagImpX',{xnt, ximp, xexp}).
 
43
-record('SeqTagExpX',{xnt, ximp, xexp}).
 
44
-record('NT',{os, bool}).
 
45
-record('Imp',{os, bool}).
 
46
-record('Exp',{os, bool}).
 
47
 
 
48
 
 
49
 
 
50
compile(Config,Rules,Options) ->
 
51
 
 
52
    ?line DataDir = ?config(data_dir,Config),
 
53
    ?line OutDir = ?config(priv_dir,Config),
 
54
    ?line true = code:add_patha(?config(priv_dir,Config)),
 
55
    ?line ok = asn1ct:compile(DataDir ++ "SeqOfTag",[Rules,{outdir,OutDir}]++Options).
 
56
 
 
57
 
 
58
 
 
59
main(_Rules) ->
 
60
    
 
61
    ?line {ok,Bytes11} = 
 
62
        asn1_wrapper:encode('SeqOfTag','SeqTagNt',
 
63
                      #'SeqTagNt'{nt = [#'NT'{bool = true, os = "kalle"},
 
64
                                        #'NT'{bool = true, os = "kalle"}]}),
 
65
    ?line {ok,{'SeqTagNt',
 
66
               [{'NT',[107,97,108,108,101],true},{'NT',[107,97,108,108,101],true}]}} = 
 
67
        asn1_wrapper:decode('SeqOfTag','SeqTagNt',lists:flatten(Bytes11)),
 
68
    
 
69
    ?line {ok,Bytes12} = 
 
70
        asn1_wrapper:encode('SeqOfTag','SeqTagNtI',
 
71
                      #'SeqTagNtI'{imp = [#'Imp'{bool = true, os = "kalle"},
 
72
                                          #'Imp'{bool = true, os = "kalle"}]}),
 
73
    ?line {ok,{'SeqTagNtI',
 
74
               [{'Imp',[107,97,108,108,101],true},{'Imp',[107,97,108,108,101],true}]}} = 
 
75
        asn1_wrapper:decode('SeqOfTag','SeqTagNtI',lists:flatten(Bytes12)),
 
76
    
 
77
    ?line {ok,Bytes13} = 
 
78
        asn1_wrapper:encode('SeqOfTag','SeqTagNtE',
 
79
                      #'SeqTagNtE'{exp = [#'Exp'{bool = true, os = "kalle"},
 
80
                                          #'Exp'{bool = true, os = "kalle"}]}),
 
81
    ?line {ok,{'SeqTagNtE',
 
82
               [{'Exp',[107,97,108,108,101],true},{'Exp',[107,97,108,108,101],true}]}} = 
 
83
        asn1_wrapper:decode('SeqOfTag','SeqTagNtE',lists:flatten(Bytes13)),
 
84
    
 
85
    
 
86
    
 
87
    ?line {ok,Bytes21} = 
 
88
        asn1_wrapper:encode('SeqOfTag','SeqTagI',
 
89
                      #'SeqTagI'{nt = [#'NT'{bool = true, os = "kalle"},
 
90
                                       #'NT'{bool = true, os = "kalle"}]}),
 
91
    ?line {ok,{'SeqTagI',
 
92
               [{'NT',[107,97,108,108,101],true},{'NT',[107,97,108,108,101],true}]}} = 
 
93
        asn1_wrapper:decode('SeqOfTag','SeqTagI',lists:flatten(Bytes21)),
 
94
    
 
95
    ?line {ok,Bytes22} = 
 
96
        asn1_wrapper:encode('SeqOfTag','SeqTagII',
 
97
                      #'SeqTagII'{imp = [#'Imp'{bool = true, os = "kalle"},
 
98
                                         #'Imp'{bool = true, os = "kalle"}]}),
 
99
    ?line {ok,{'SeqTagII',
 
100
               [{'Imp',[107,97,108,108,101],true},{'Imp',[107,97,108,108,101],true}]}} = 
 
101
        asn1_wrapper:decode('SeqOfTag','SeqTagII',lists:flatten(Bytes22)),
 
102
    
 
103
    ?line {ok,Bytes23} = 
 
104
        asn1_wrapper:encode('SeqOfTag','SeqTagIE',
 
105
                      #'SeqTagIE'{exp = [#'Exp'{bool = true, os = "kalle"},
 
106
                                         #'Exp'{bool = true, os = "kalle"}]}),
 
107
    ?line {ok,{'SeqTagIE',
 
108
               [{'Exp',[107,97,108,108,101],true},{'Exp',[107,97,108,108,101],true}]}} = 
 
109
        asn1_wrapper:decode('SeqOfTag','SeqTagIE',lists:flatten(Bytes23)),
 
110
    
 
111
    
 
112
    
 
113
    ?line {ok,Bytes31} = 
 
114
        asn1_wrapper:encode('SeqOfTag','SeqTagE',
 
115
                      #'SeqTagE'{nt = [#'NT'{bool = true, os = "kalle"},
 
116
                                       #'NT'{bool = true, os = "kalle"}]}),
 
117
    ?line {ok,{'SeqTagE',
 
118
               [{'NT',[107,97,108,108,101],true},{'NT',[107,97,108,108,101],true}]}} = 
 
119
        asn1_wrapper:decode('SeqOfTag','SeqTagE',lists:flatten(Bytes31)),
 
120
    
 
121
    ?line {ok,Bytes32} = 
 
122
        asn1_wrapper:encode('SeqOfTag','SeqTagEI',
 
123
                      #'SeqTagEI'{imp = [#'Imp'{bool = true, os = "kalle"},
 
124
                                         #'Imp'{bool = true, os = "kalle"}]}),
 
125
    ?line {ok,{'SeqTagEI',
 
126
               [{'Imp',[107,97,108,108,101],true},{'Imp',[107,97,108,108,101],true}]}} = 
 
127
        asn1_wrapper:decode('SeqOfTag','SeqTagEI',lists:flatten(Bytes32)),
 
128
    
 
129
    ?line {ok,Bytes33} = 
 
130
        asn1_wrapper:encode('SeqOfTag','SeqTagEE',
 
131
                      #'SeqTagEE'{exp = [#'Exp'{bool = true, os = "kalle"},
 
132
                                         #'Exp'{bool = true, os = "kalle"}]}),
 
133
    ?line {ok,{'SeqTagEE',
 
134
               [{'Exp',[107,97,108,108,101],true},{'Exp',[107,97,108,108,101],true}]}} = 
 
135
        asn1_wrapper:decode('SeqOfTag','SeqTagEE',lists:flatten(Bytes33)),
 
136
    
 
137
    
 
138
    
 
139
    
 
140
 
 
141
 
 
142
 
 
143
    ?line {ok,Bytes41} = 
 
144
        asn1_wrapper:encode('SeqOfTag','SeqTagXNt',
 
145
                      #'SeqTagXNt'{xnt = [#'XSeqNT'{bool = true, os = "kalle"},
 
146
                                          #'XSeqNT'{bool = true, os = "kalle"}]}),
 
147
    ?line {ok,{'SeqTagXNt',
 
148
               [{'XSeqNT',[107,97,108,108,101],true},{'XSeqNT',[107,97,108,108,101],true}]}} = 
 
149
        asn1_wrapper:decode('SeqOfTag','SeqTagXNt',lists:flatten(Bytes41)),
 
150
    
 
151
    ?line {ok,Bytes42} = 
 
152
        asn1_wrapper:encode('SeqOfTag','SeqTagXI',
 
153
                      #'SeqTagXI'{ximp = [#'XSeqImp'{bool = true, os = "kalle"},
 
154
                                          #'XSeqImp'{bool = true, os = "kalle"}]}),
 
155
    ?line {ok,{'SeqTagXI',
 
156
               [{'XSeqImp',[107,97,108,108,101],true},{'XSeqImp',[107,97,108,108,101],true}]}} = 
 
157
        asn1_wrapper:decode('SeqOfTag','SeqTagXI',lists:flatten(Bytes42)),
 
158
    
 
159
    ?line {ok,Bytes43} = 
 
160
        asn1_wrapper:encode('SeqOfTag','SeqTagXE',
 
161
                      #'SeqTagXE'{xexp = [#'XSeqExp'{bool = true, os = "kalle"},
 
162
                                          #'XSeqExp'{bool = true, os = "kalle"}]}),
 
163
    ?line {ok,{'SeqTagXE',
 
164
               [{'XSeqExp',[107,97,108,108,101],true},{'XSeqExp',[107,97,108,108,101],true}]}} = 
 
165
        asn1_wrapper:decode('SeqOfTag','SeqTagXE',lists:flatten(Bytes43)),
 
166
        
 
167
    
 
168
 
 
169
 
 
170
    
 
171
    ?line {ok,Bytes51} = 
 
172
        asn1_wrapper:encode('SeqOfTag','SeqTagImpX',
 
173
                      #'SeqTagImpX'{xnt = [#'XSeqNT'{bool = true, os = "kalle"},
 
174
                                           #'XSeqNT'{bool = true, os = "kalle"}],
 
175
                                    ximp = [#'XSeqImp'{bool = true, os = "kalle"},
 
176
                                            #'XSeqImp'{bool = true, os = "kalle"}],
 
177
                                    xexp = [#'XSeqExp'{bool = true, os = "kalle"},
 
178
                                            #'XSeqExp'{bool = true, os = "kalle"}]}),
 
179
    ?line {ok,{'SeqTagImpX',
 
180
               [{'XSeqNT',[107,97,108,108,101],true},{'XSeqNT',[107,97,108,108,101],true}], 
 
181
               [{'XSeqImp',[107,97,108,108,101],true},{'XSeqImp',[107,97,108,108,101],true}],
 
182
               [{'XSeqExp',[107,97,108,108,101],true},{'XSeqExp',[107,97,108,108,101],true}]}} = 
 
183
        asn1_wrapper:decode('SeqOfTag','SeqTagImpX',lists:flatten(Bytes51)),
 
184
    
 
185
 
 
186
 
 
187
    ?line {ok,Bytes52} = 
 
188
        asn1_wrapper:encode('SeqOfTag','SeqTagExpX',
 
189
                      #'SeqTagExpX'{xnt = [#'XSeqNT'{bool = true, os = "kalle"},
 
190
                                           #'XSeqNT'{bool = true, os = "kalle"}],
 
191
                                    ximp = [#'XSeqImp'{bool = true, os = "kalle"},
 
192
                                            #'XSeqImp'{bool = true, os = "kalle"}],
 
193
                                    xexp = [#'XSeqExp'{bool = true, os = "kalle"},
 
194
                                            #'XSeqExp'{bool = true, os = "kalle"}]}),
 
195
    ?line {ok,{'SeqTagExpX',
 
196
               [{'XSeqNT',[107,97,108,108,101],true},{'XSeqNT',[107,97,108,108,101],true}], 
 
197
               [{'XSeqImp',[107,97,108,108,101],true},{'XSeqImp',[107,97,108,108,101],true}],
 
198
               [{'XSeqExp',[107,97,108,108,101],true},{'XSeqExp',[107,97,108,108,101],true}]}} = 
 
199
        asn1_wrapper:decode('SeqOfTag','SeqTagExpX',lists:flatten(Bytes52)),
 
200
    
 
201
ok.