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

« back to all changes in this revision

Viewing changes to lib/asn1/test/testSetOfTag.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(testSetOfTag).
 
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('SetTagNt',{nt}).
 
31
-record('SetTagNtI',{imp}).
 
32
-record('SetTagNtE',{exp}).
 
33
-record('SetTagI',{nt}).
 
34
-record('SetTagII',{imp}).
 
35
-record('SetTagIE',{exp}).
 
36
-record('SetTagE',{nt}).
 
37
-record('SetTagEI',{imp}).
 
38
-record('SetTagEE',{exp}).
 
39
-record('SetTagXNt',{xnt}).
 
40
-record('SetTagXI',{ximp}).
 
41
-record('SetTagXE',{xexp}).
 
42
-record('SetTagImpX',{xnt, ximp, xexp}).
 
43
-record('SetTagExpX',{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 ++ "SetOfTag",[Rules,{outdir,OutDir}]++Options).
 
56
 
 
57
 
 
58
 
 
59
main(_Rules) ->
 
60
    
 
61
    ?line {ok,Bytes11} = 
 
62
        asn1_wrapper:encode('SetOfTag','SetTagNt',
 
63
                      #'SetTagNt'{nt = [#'NT'{bool = true, os = "kalle"},
 
64
                                        #'NT'{bool = true, os = "kalle"}]}),
 
65
    ?line {ok,{'SetTagNt',
 
66
               [{'NT',[107,97,108,108,101],true},{'NT',[107,97,108,108,101],true}]}} = 
 
67
        asn1_wrapper:decode('SetOfTag','SetTagNt',lists:flatten(Bytes11)),
 
68
    
 
69
    ?line {ok,Bytes12} = 
 
70
        asn1_wrapper:encode('SetOfTag','SetTagNtI',
 
71
                      #'SetTagNtI'{imp = [#'Imp'{bool = true, os = "kalle"},
 
72
                                          #'Imp'{bool = true, os = "kalle"}]}),
 
73
    ?line {ok,{'SetTagNtI',
 
74
               [{'Imp',[107,97,108,108,101],true},{'Imp',[107,97,108,108,101],true}]}} = 
 
75
        asn1_wrapper:decode('SetOfTag','SetTagNtI',lists:flatten(Bytes12)),
 
76
    
 
77
    ?line {ok,Bytes13} = 
 
78
        asn1_wrapper:encode('SetOfTag','SetTagNtE',
 
79
                      #'SetTagNtE'{exp = [#'Exp'{bool = true, os = "kalle"},
 
80
                                          #'Exp'{bool = true, os = "kalle"}]}),
 
81
    ?line {ok,{'SetTagNtE',
 
82
               [{'Exp',[107,97,108,108,101],true},{'Exp',[107,97,108,108,101],true}]}} = 
 
83
        asn1_wrapper:decode('SetOfTag','SetTagNtE',lists:flatten(Bytes13)),
 
84
    
 
85
    
 
86
    
 
87
    ?line {ok,Bytes21} = 
 
88
        asn1_wrapper:encode('SetOfTag','SetTagI',
 
89
                      #'SetTagI'{nt = [#'NT'{bool = true, os = "kalle"},
 
90
                                       #'NT'{bool = true, os = "kalle"}]}),
 
91
    ?line {ok,{'SetTagI',
 
92
               [{'NT',[107,97,108,108,101],true},{'NT',[107,97,108,108,101],true}]}} = 
 
93
        asn1_wrapper:decode('SetOfTag','SetTagI',lists:flatten(Bytes21)),
 
94
    
 
95
    ?line {ok,Bytes22} = 
 
96
        asn1_wrapper:encode('SetOfTag','SetTagII',
 
97
                      #'SetTagII'{imp = [#'Imp'{bool = true, os = "kalle"},
 
98
                                         #'Imp'{bool = true, os = "kalle"}]}),
 
99
    ?line {ok,{'SetTagII',
 
100
               [{'Imp',[107,97,108,108,101],true},{'Imp',[107,97,108,108,101],true}]}} = 
 
101
        asn1_wrapper:decode('SetOfTag','SetTagII',lists:flatten(Bytes22)),
 
102
    
 
103
    ?line {ok,Bytes23} = 
 
104
        asn1_wrapper:encode('SetOfTag','SetTagIE',
 
105
                      #'SetTagIE'{exp = [#'Exp'{bool = true, os = "kalle"},
 
106
                                         #'Exp'{bool = true, os = "kalle"}]}),
 
107
    ?line {ok,{'SetTagIE',
 
108
               [{'Exp',[107,97,108,108,101],true},{'Exp',[107,97,108,108,101],true}]}} = 
 
109
        asn1_wrapper:decode('SetOfTag','SetTagIE',lists:flatten(Bytes23)),
 
110
    
 
111
    
 
112
    
 
113
    ?line {ok,Bytes31} = 
 
114
        asn1_wrapper:encode('SetOfTag','SetTagE',
 
115
                      #'SetTagE'{nt = [#'NT'{bool = true, os = "kalle"},
 
116
                                       #'NT'{bool = true, os = "kalle"}]}),
 
117
    ?line {ok,{'SetTagE',
 
118
               [{'NT',[107,97,108,108,101],true},{'NT',[107,97,108,108,101],true}]}} = 
 
119
        asn1_wrapper:decode('SetOfTag','SetTagE',lists:flatten(Bytes31)),
 
120
    
 
121
    ?line {ok,Bytes32} = 
 
122
        asn1_wrapper:encode('SetOfTag','SetTagEI',
 
123
                      #'SetTagEI'{imp = [#'Imp'{bool = true, os = "kalle"},
 
124
                                         #'Imp'{bool = true, os = "kalle"}]}),
 
125
    ?line {ok,{'SetTagEI',
 
126
               [{'Imp',[107,97,108,108,101],true},{'Imp',[107,97,108,108,101],true}]}} = 
 
127
        asn1_wrapper:decode('SetOfTag','SetTagEI',lists:flatten(Bytes32)),
 
128
    
 
129
    ?line {ok,Bytes33} = 
 
130
        asn1_wrapper:encode('SetOfTag','SetTagEE',
 
131
                      #'SetTagEE'{exp = [#'Exp'{bool = true, os = "kalle"},
 
132
                                         #'Exp'{bool = true, os = "kalle"}]}),
 
133
    ?line {ok,{'SetTagEE',
 
134
               [{'Exp',[107,97,108,108,101],true},{'Exp',[107,97,108,108,101],true}]}} = 
 
135
        asn1_wrapper:decode('SetOfTag','SetTagEE',lists:flatten(Bytes33)),
 
136
    
 
137
    
 
138
    
 
139
    
 
140
 
 
141
 
 
142
 
 
143
    ?line {ok,Bytes41} = 
 
144
        asn1_wrapper:encode('SetOfTag','SetTagXNt',
 
145
                      #'SetTagXNt'{xnt = [#'XSetNT'{bool = true, os = "kalle"},
 
146
                                          #'XSetNT'{bool = true, os = "kalle"}]}),
 
147
    ?line {ok,{'SetTagXNt',
 
148
               [{'XSetNT',[107,97,108,108,101],true},{'XSetNT',[107,97,108,108,101],true}]}} = 
 
149
        asn1_wrapper:decode('SetOfTag','SetTagXNt',lists:flatten(Bytes41)),
 
150
    
 
151
    ?line {ok,Bytes42} = 
 
152
        asn1_wrapper:encode('SetOfTag','SetTagXI',
 
153
                      #'SetTagXI'{ximp = [#'XSetImp'{bool = true, os = "kalle"},
 
154
                                          #'XSetImp'{bool = true, os = "kalle"}]}),
 
155
    ?line {ok,{'SetTagXI',
 
156
               [{'XSetImp',[107,97,108,108,101],true},{'XSetImp',[107,97,108,108,101],true}]}} = 
 
157
        asn1_wrapper:decode('SetOfTag','SetTagXI',lists:flatten(Bytes42)),
 
158
    
 
159
    ?line {ok,Bytes43} = 
 
160
        asn1_wrapper:encode('SetOfTag','SetTagXE',
 
161
                      #'SetTagXE'{xexp = [#'XSetExp'{bool = true, os = "kalle"},
 
162
                                          #'XSetExp'{bool = true, os = "kalle"}]}),
 
163
    ?line {ok,{'SetTagXE',
 
164
               [{'XSetExp',[107,97,108,108,101],true},{'XSetExp',[107,97,108,108,101],true}]}} = 
 
165
        asn1_wrapper:decode('SetOfTag','SetTagXE',lists:flatten(Bytes43)),
 
166
        
 
167
    
 
168
 
 
169
 
 
170
    
 
171
    ?line {ok,Bytes51} = 
 
172
        asn1_wrapper:encode('SetOfTag','SetTagImpX',
 
173
                      #'SetTagImpX'{xnt = [#'XSetNT'{bool = true, os = "kalle"},
 
174
                                           #'XSetNT'{bool = true, os = "kalle"}],
 
175
                                    ximp = [#'XSetImp'{bool = true, os = "kalle"},
 
176
                                            #'XSetImp'{bool = true, os = "kalle"}],
 
177
                                    xexp = [#'XSetExp'{bool = true, os = "kalle"},
 
178
                                            #'XSetExp'{bool = true, os = "kalle"}]}),
 
179
    ?line {ok,{'SetTagImpX',
 
180
               [{'XSetNT',[107,97,108,108,101],true},{'XSetNT',[107,97,108,108,101],true}], 
 
181
               [{'XSetImp',[107,97,108,108,101],true},{'XSetImp',[107,97,108,108,101],true}],
 
182
               [{'XSetExp',[107,97,108,108,101],true},{'XSetExp',[107,97,108,108,101],true}]}} = 
 
183
        asn1_wrapper:decode('SetOfTag','SetTagImpX',lists:flatten(Bytes51)),
 
184
    
 
185
 
 
186
 
 
187
    ?line {ok,Bytes52} = 
 
188
        asn1_wrapper:encode('SetOfTag','SetTagExpX',
 
189
                      #'SetTagExpX'{xnt = [#'XSetNT'{bool = true, os = "kalle"},
 
190
                                           #'XSetNT'{bool = true, os = "kalle"}],
 
191
                                    ximp = [#'XSetImp'{bool = true, os = "kalle"},
 
192
                                            #'XSetImp'{bool = true, os = "kalle"}],
 
193
                                    xexp = [#'XSetExp'{bool = true, os = "kalle"},
 
194
                                            #'XSetExp'{bool = true, os = "kalle"}]}),
 
195
    ?line {ok,{'SetTagExpX',
 
196
               [{'XSetNT',[107,97,108,108,101],true},{'XSetNT',[107,97,108,108,101],true}], 
 
197
               [{'XSetImp',[107,97,108,108,101],true},{'XSetImp',[107,97,108,108,101],true}],
 
198
               [{'XSetExp',[107,97,108,108,101],true},{'XSetExp',[107,97,108,108,101],true}]}} = 
 
199
        asn1_wrapper:decode('SetOfTag','SetTagExpX',lists:flatten(Bytes52)),
 
200
    
 
201
    ok.