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

« back to all changes in this revision

Viewing changes to lib/asn1/test/testSeqDefault.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(testSeqDefault).
 
21
 
 
22
-include("External.hrl").
 
23
-export([compile/3]).
 
24
-export([main/1]).
 
25
 
 
26
-include_lib("test_server/include/test_server.hrl").
 
27
 
 
28
-record('SeqDef1',{bool1 = asn1_DEFAULT, int1, seq1 = asn1_DEFAULT}).
 
29
-record('SeqDef1Imp',{bool1 = asn1_DEFAULT, int1, seq1 = asn1_DEFAULT}).
 
30
-record('SeqDef1Exp',{bool1 = asn1_DEFAULT, int1, seq1 = asn1_DEFAULT}).
 
31
-record('SeqDef2',{seq2 = asn1_DEFAULT, bool2 = asn1_DEFAULT, int2}).
 
32
-record('SeqDef2Imp',{seq2 = asn1_DEFAULT, bool2 = asn1_DEFAULT, int2}).
 
33
-record('SeqDef2Exp',{seq2 = asn1_DEFAULT, bool2, int2}).
 
34
-record('SeqDef3',{bool3 = asn1_DEFAULT, seq3 = asn1_DEFAULT, int3 = asn1_DEFAULT}).
 
35
-record('SeqDef3Imp',{bool3 = asn1_DEFAULT, seq3 = asn1_DEFAULT, int3 = asn1_DEFAULT}).
 
36
-record('SeqDef3Exp',{bool3 = asn1_DEFAULT, seq3 = asn1_DEFAULT, int3 = asn1_DEFAULT}).
 
37
-record('SeqIn',{boolIn, intIn}).
 
38
 
 
39
 
 
40
compile(Config,Rules,Options) ->
 
41
 
 
42
    ?line DataDir = ?config(data_dir,Config),
 
43
    ?line OutDir = ?config(priv_dir,Config),
 
44
    ?line true = code:add_patha(?config(priv_dir,Config)),
 
45
    ?line ok = asn1ct:compile(DataDir ++ "SeqDefault",[Rules,{outdir,OutDir}]++Options).
 
46
 
 
47
 
 
48
 
 
49
main(_Rules) ->
 
50
    
 
51
    ?line {ok,Bytes11} = 
 
52
        asn1_wrapper:encode('SeqDefault','SeqDef1',#'SeqDef1'{bool1 = true,
 
53
                                                        int1 = 15,
 
54
                                                        seq1 = #'SeqIn'{boolIn = true,
 
55
                                                                        intIn = 66}}), 
 
56
    ?line {ok,{'SeqDef1',true,15,{'SeqIn',true,66}}} = 
 
57
        asn1_wrapper:decode('SeqDefault','SeqDef1',lists:flatten(Bytes11)),
 
58
    
 
59
    
 
60
    ?line {ok,Bytes12} = asn1_wrapper:encode('SeqDefault','SeqDef1',#'SeqDef1'{int1 = 15}), 
 
61
    ?line {ok,{'SeqDef1',true,15,{'SeqIn',asn1_NOVALUE,12}}} = 
 
62
        asn1_wrapper:decode('SeqDefault','SeqDef1',lists:flatten(Bytes12)),
 
63
    
 
64
    
 
65
    ?line {ok,Bytes21} = 
 
66
        asn1_wrapper:encode('SeqDefault','SeqDef2',#'SeqDef2'{bool2 = true,
 
67
                                                        int2 = 15,
 
68
                                                        seq2 = #'SeqIn'{boolIn = true,
 
69
                                                                        intIn = 66}}), 
 
70
    ?line {ok,{'SeqDef2',{'SeqIn',true,66},true,15}} = 
 
71
        asn1_wrapper:decode('SeqDefault','SeqDef2',lists:flatten(Bytes21)),
 
72
    
 
73
    
 
74
    ?line {ok,Bytes22} = asn1_wrapper:encode('SeqDefault','SeqDef2',#'SeqDef2'{int2 = 15}), 
 
75
    ?line {ok,{'SeqDef2',{'SeqIn',asn1_NOVALUE,12},true,15}} = 
 
76
        asn1_wrapper:decode('SeqDefault','SeqDef2',lists:flatten(Bytes22)),
 
77
    
 
78
    
 
79
    
 
80
    ?line {ok,Bytes31} = 
 
81
        asn1_wrapper:encode('SeqDefault','SeqDef3',#'SeqDef3'{bool3 = true,
 
82
                                                        int3 = 15,
 
83
                                                        seq3 = #'SeqIn'{boolIn = true,
 
84
                                                                        intIn = 66}}), 
 
85
    ?line {ok,{'SeqDef3',true,{'SeqIn',true,66},15}} = 
 
86
        asn1_wrapper:decode('SeqDefault','SeqDef3',lists:flatten(Bytes31)),
 
87
    
 
88
    
 
89
    ?line {ok,Bytes32} = asn1_wrapper:encode('SeqDefault','SeqDef3',#'SeqDef3'{int3 = 15}), 
 
90
    ?line {ok,{'SeqDef3',true,{'SeqIn',asn1_NOVALUE,12},15}} = 
 
91
        asn1_wrapper:decode('SeqDefault','SeqDef3',lists:flatten(Bytes32)),
 
92
    
 
93
    
 
94
    
 
95
    
 
96
    
 
97
    ?line {ok,Bytes41} = 
 
98
        asn1_wrapper:encode('SeqDefault','SeqDef1Imp',#'SeqDef1Imp'{bool1 = true,
 
99
                                                              int1 = 15,
 
100
                                                              seq1 = #'SeqIn'{boolIn = true,
 
101
                                                                              intIn = 66}}), 
 
102
    ?line {ok,{'SeqDef1Imp',true,15,{'SeqIn',true,66}}} = 
 
103
        asn1_wrapper:decode('SeqDefault','SeqDef1Imp',lists:flatten(Bytes41)),
 
104
    
 
105
    
 
106
    ?line {ok,Bytes42} = asn1_wrapper:encode('SeqDefault','SeqDef1Imp',#'SeqDef1Imp'{int1 = 15}), 
 
107
    ?line {ok,{'SeqDef1Imp',true,15,{'SeqIn',asn1_NOVALUE,12}}} = 
 
108
        asn1_wrapper:decode('SeqDefault','SeqDef1Imp',lists:flatten(Bytes42)),
 
109
    
 
110
    
 
111
    ?line {ok,Bytes51} = 
 
112
        asn1_wrapper:encode('SeqDefault','SeqDef2Imp',#'SeqDef2Imp'{bool2 = true,
 
113
                                                              int2 = 15,
 
114
                                                              seq2 = #'SeqIn'{boolIn = true,
 
115
                                                                              intIn = 66}}), 
 
116
    ?line {ok,{'SeqDef2Imp',{'SeqIn',true,66},true,15}} = 
 
117
        asn1_wrapper:decode('SeqDefault','SeqDef2Imp',lists:flatten(Bytes51)),
 
118
    
 
119
    
 
120
    ?line {ok,Bytes52} = asn1_wrapper:encode('SeqDefault','SeqDef2Imp',#'SeqDef2Imp'{int2 = 15}), 
 
121
    ?line {ok,{'SeqDef2Imp',{'SeqIn',asn1_NOVALUE,12},true,15}} = 
 
122
        asn1_wrapper:decode('SeqDefault','SeqDef2Imp',lists:flatten(Bytes52)),
 
123
    
 
124
    
 
125
    
 
126
    ?line {ok,Bytes61} = 
 
127
        asn1_wrapper:encode('SeqDefault','SeqDef3Imp',#'SeqDef3Imp'{bool3 = true,
 
128
                                                              int3 = 15,
 
129
                                                              seq3 = #'SeqIn'{boolIn = true,
 
130
                                                                              intIn = 66}}), 
 
131
    ?line {ok,{'SeqDef3Imp',true,{'SeqIn',true,66},15}} = 
 
132
        asn1_wrapper:decode('SeqDefault','SeqDef3Imp',lists:flatten(Bytes61)),
 
133
    
 
134
    
 
135
    ?line {ok,Bytes62} = asn1_wrapper:encode('SeqDefault','SeqDef3Imp',#'SeqDef3Imp'{int3 = 15}), 
 
136
    ?line {ok,{'SeqDef3Imp',true,{'SeqIn',asn1_NOVALUE,12},15}} = 
 
137
        asn1_wrapper:decode('SeqDefault','SeqDef3Imp',lists:flatten(Bytes62)),
 
138
    
 
139
    
 
140
    
 
141
    
 
142
    
 
143
    
 
144
    ?line {ok,Bytes71} = 
 
145
        asn1_wrapper:encode('SeqDefault','SeqDef1Exp',#'SeqDef1Exp'{bool1 = true,
 
146
                                                              int1 = 15,
 
147
                                                              seq1 = #'SeqIn'{boolIn = true,
 
148
                                                                              intIn = 66}}), 
 
149
    ?line {ok,{'SeqDef1Exp',true,15,{'SeqIn',true,66}}} = 
 
150
        asn1_wrapper:decode('SeqDefault','SeqDef1Exp',lists:flatten(Bytes71)),
 
151
    
 
152
    
 
153
    ?line {ok,Bytes72} = asn1_wrapper:encode('SeqDefault','SeqDef1Exp',#'SeqDef1Exp'{int1 = 15}), 
 
154
    ?line {ok,{'SeqDef1Exp',true,15,{'SeqIn',asn1_NOVALUE,12}}} = 
 
155
        asn1_wrapper:decode('SeqDefault','SeqDef1Exp',lists:flatten(Bytes72)),
 
156
    
 
157
    
 
158
    ?line {ok,Bytes81} = 
 
159
        asn1_wrapper:encode('SeqDefault','SeqDef2Exp',#'SeqDef2Exp'{bool2 = true,
 
160
                                                              int2 = 15,
 
161
                                                              seq2 = #'SeqIn'{boolIn = true,
 
162
                                                                              intIn = 66}}), 
 
163
    ?line {ok,{'SeqDef2Exp',{'SeqIn',true,66},true,15}} = 
 
164
        asn1_wrapper:decode('SeqDefault','SeqDef2Exp',lists:flatten(Bytes81)),
 
165
    
 
166
    
 
167
    ?line {ok,Bytes82} = asn1_wrapper:encode('SeqDefault','SeqDef2Exp',#'SeqDef2Exp'{int2 = 15,
 
168
                                                                               bool2 = true}), 
 
169
    ?line {ok,{'SeqDef2Exp',{'SeqIn',asn1_NOVALUE,12},true,15}} = 
 
170
        asn1_wrapper:decode('SeqDefault','SeqDef2Exp',lists:flatten(Bytes82)),
 
171
    
 
172
    
 
173
    
 
174
    ?line {ok,Bytes91} = 
 
175
        asn1_wrapper:encode('SeqDefault','SeqDef3Exp',#'SeqDef3Exp'{bool3 = true,
 
176
                                                              int3 = 15,
 
177
                                                              seq3 = #'SeqIn'{boolIn = true,
 
178
                                                                              intIn = 66}}), 
 
179
    ?line {ok,{'SeqDef3Exp',true,{'SeqIn',true,66},15}} = 
 
180
        asn1_wrapper:decode('SeqDefault','SeqDef3Exp',lists:flatten(Bytes91)),
 
181
    
 
182
    
 
183
    ?line {ok,Bytes92} = asn1_wrapper:encode('SeqDefault','SeqDef3Exp',#'SeqDef3Exp'{int3 = 15}), 
 
184
    ?line {ok,{'SeqDef3Exp',true,{'SeqIn',asn1_NOVALUE,12},15}} = 
 
185
        asn1_wrapper:decode('SeqDefault','SeqDef3Exp',lists:flatten(Bytes92)),
 
186
    
 
187
    
 
188
    
 
189
    
 
190
    ok.