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

« back to all changes in this revision

Viewing changes to lib/asn1/test/testSetOfExternal.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(testSetOfExternal).
 
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
-record('NT',{os, bool}).
 
30
-record('Imp',{os, bool}).
 
31
-record('Exp',{os, bool}).
 
32
 
 
33
 
 
34
 
 
35
compile(Config,Rules,Options) ->
 
36
 
 
37
    ?line DataDir = ?config(data_dir,Config),
 
38
    ?line OutDir = ?config(priv_dir,Config),
 
39
    ?line true = code:add_patha(?config(priv_dir,Config)),
 
40
    ?line ok = asn1ct:compile(DataDir ++ "SetOfExternal",[Rules,{outdir,OutDir}]++Options).
 
41
 
 
42
 
 
43
 
 
44
main(_Rules) ->
 
45
    
 
46
    ?line {ok,Bytes11} = 
 
47
        asn1_wrapper:encode('SetOfExternal','NTNT',[#'NT'{bool = true, os = "kalle"},
 
48
                                              #'NT'{bool = true, os = "kalle"}]),
 
49
    ?line {ok,[{'NT',[107,97,108,108,101],true},{'NT',[107,97,108,108,101],true}]} = 
 
50
        asn1_wrapper:decode('SetOfExternal','NTNT',lists:flatten(Bytes11)),
 
51
 
 
52
    ?line {ok,Bytes12} = 
 
53
        asn1_wrapper:encode('SetOfExternal','ImpNT',[#'NT'{bool = true, os = "kalle"},
 
54
                                               #'NT'{bool = true, os = "kalle"}]),
 
55
    ?line {ok,[{'NT',[107,97,108,108,101],true},{'NT',[107,97,108,108,101],true}]} = 
 
56
        asn1_wrapper:decode('SetOfExternal','ImpNT',lists:flatten(Bytes12)),
 
57
 
 
58
    ?line {ok,Bytes13} = 
 
59
        asn1_wrapper:encode('SetOfExternal','ExpNT',[#'NT'{bool = true, os = "kalle"},
 
60
                                               #'NT'{bool = true, os = "kalle"}]),
 
61
    ?line {ok,[{'NT',[107,97,108,108,101],true},{'NT',[107,97,108,108,101],true}]} = 
 
62
        asn1_wrapper:decode('SetOfExternal','ExpNT',lists:flatten(Bytes13)),
 
63
 
 
64
    
 
65
 
 
66
    ?line {ok,Bytes21} = 
 
67
        asn1_wrapper:encode('SetOfExternal','NTImp',[#'Imp'{bool = true, os = "kalle"},
 
68
                                               #'Imp'{bool = true, os = "kalle"}]),
 
69
    ?line {ok,[{'Imp',[107,97,108,108,101],true},{'Imp',[107,97,108,108,101],true}]} = 
 
70
        asn1_wrapper:decode('SetOfExternal','NTImp',lists:flatten(Bytes21)),
 
71
 
 
72
    ?line {ok,Bytes22} = 
 
73
        asn1_wrapper:encode('SetOfExternal','ImpImp',[#'Imp'{bool = true, os = "kalle"},
 
74
                                                #'Imp'{bool = true, os = "kalle"}]),
 
75
    ?line {ok,[{'Imp',[107,97,108,108,101],true},{'Imp',[107,97,108,108,101],true}]} = 
 
76
        asn1_wrapper:decode('SetOfExternal','ImpImp',lists:flatten(Bytes22)),
 
77
 
 
78
    ?line {ok,Bytes23} = 
 
79
        asn1_wrapper:encode('SetOfExternal','ExpImp',[#'Imp'{bool = true, os = "kalle"},
 
80
                                                #'Imp'{bool = true, os = "kalle"}]),
 
81
    ?line {ok,[{'Imp',[107,97,108,108,101],true},{'Imp',[107,97,108,108,101],true}]} = 
 
82
        asn1_wrapper:decode('SetOfExternal','ExpImp',lists:flatten(Bytes23)),
 
83
 
 
84
 
 
85
    
 
86
    ?line {ok,Bytes31} = 
 
87
        asn1_wrapper:encode('SetOfExternal','NTExp',[#'Exp'{bool = true, os = "kalle"},
 
88
                                               #'Exp'{bool = true, os = "kalle"}]),
 
89
    ?line {ok,[{'Exp',[107,97,108,108,101],true},{'Exp',[107,97,108,108,101],true}]} = 
 
90
        asn1_wrapper:decode('SetOfExternal','NTExp',lists:flatten(Bytes31)),
 
91
 
 
92
    ?line {ok,Bytes32} = 
 
93
        asn1_wrapper:encode('SetOfExternal','ImpExp',[#'Exp'{bool = true, os = "kalle"},
 
94
                                                #'Exp'{bool = true, os = "kalle"}]),
 
95
    ?line {ok,[{'Exp',[107,97,108,108,101],true},{'Exp',[107,97,108,108,101],true}]} = 
 
96
        asn1_wrapper:decode('SetOfExternal','ImpExp',lists:flatten(Bytes32)),
 
97
 
 
98
    ?line {ok,Bytes33} = 
 
99
        asn1_wrapper:encode('SetOfExternal','ExpExp',[#'Exp'{bool = true, os = "kalle"},
 
100
                                                #'Exp'{bool = true, os = "kalle"}]),
 
101
    ?line {ok,[{'Exp',[107,97,108,108,101],true},{'Exp',[107,97,108,108,101],true}]} = 
 
102
        asn1_wrapper:decode('SetOfExternal','ExpExp',lists:flatten(Bytes33)),
 
103
 
 
104
 
 
105
 
 
106
 
 
107
 
 
108
 
 
109
 
 
110
    ?line {ok,Bytes41} = 
 
111
        asn1_wrapper:encode('SetOfExternal','XNTNT',[#'XSetNT'{bool = true, os = "kalle"},
 
112
                                               #'XSetNT'{bool = true, os = "kalle"}]),
 
113
    ?line {ok,[{'XSetNT',[107,97,108,108,101],true},{'XSetNT',[107,97,108,108,101],true}]} = 
 
114
        asn1_wrapper:decode('SetOfExternal','XNTNT',lists:flatten(Bytes41)),
 
115
 
 
116
    ?line {ok,Bytes42} = 
 
117
        asn1_wrapper:encode('SetOfExternal','XImpNT',[#'XSetNT'{bool = true, os = "kalle"},
 
118
                                                #'XSetNT'{bool = true, os = "kalle"}]),
 
119
    ?line {ok,[{'XSetNT',[107,97,108,108,101],true},{'XSetNT',[107,97,108,108,101],true}]} = 
 
120
        asn1_wrapper:decode('SetOfExternal','XImpNT',lists:flatten(Bytes42)),
 
121
 
 
122
    ?line {ok,Bytes43} = 
 
123
        asn1_wrapper:encode('SetOfExternal','XExpNT',[#'XSetNT'{bool = true, os = "kalle"},
 
124
                                                #'XSetNT'{bool = true, os = "kalle"}]),
 
125
    ?line {ok,[{'XSetNT',[107,97,108,108,101],true},{'XSetNT',[107,97,108,108,101],true}]} = 
 
126
        asn1_wrapper:decode('SetOfExternal','XExpNT',lists:flatten(Bytes43)),
 
127
 
 
128
    
 
129
 
 
130
    ?line {ok,Bytes51} = 
 
131
        asn1_wrapper:encode('SetOfExternal','XNTImp',[#'XSetImp'{bool = true, os = "kalle"},
 
132
                                                #'XSetImp'{bool = true, os = "kalle"}]),
 
133
    ?line {ok,[{'XSetImp',[107,97,108,108,101],true},{'XSetImp',[107,97,108,108,101],true}]} = 
 
134
        asn1_wrapper:decode('SetOfExternal','XNTImp',lists:flatten(Bytes51)),
 
135
 
 
136
    ?line {ok,Bytes52} = 
 
137
        asn1_wrapper:encode('SetOfExternal','XImpImp',[#'XSetImp'{bool = true, os = "kalle"},
 
138
                                                 #'XSetImp'{bool = true, os = "kalle"}]),
 
139
    ?line {ok,[{'XSetImp',[107,97,108,108,101],true},{'XSetImp',[107,97,108,108,101],true}]} = 
 
140
        asn1_wrapper:decode('SetOfExternal','XImpImp',lists:flatten(Bytes52)),
 
141
 
 
142
    ?line {ok,Bytes53} = 
 
143
        asn1_wrapper:encode('SetOfExternal','XExpImp',[#'XSetImp'{bool = true, os = "kalle"},
 
144
                                                 #'XSetImp'{bool = true, os = "kalle"}]),
 
145
    ?line {ok,[{'XSetImp',[107,97,108,108,101],true},{'XSetImp',[107,97,108,108,101],true}]} = 
 
146
        asn1_wrapper:decode('SetOfExternal','XExpImp',lists:flatten(Bytes53)),
 
147
 
 
148
 
 
149
    
 
150
    ?line {ok,Bytes61} = 
 
151
        asn1_wrapper:encode('SetOfExternal','XNTExp',[#'XSetExp'{bool = true, os = "kalle"},
 
152
                                                #'XSetExp'{bool = true, os = "kalle"}]),
 
153
    ?line {ok,[{'XSetExp',[107,97,108,108,101],true},{'XSetExp',[107,97,108,108,101],true}]} = 
 
154
        asn1_wrapper:decode('SetOfExternal','XNTExp',lists:flatten(Bytes61)),
 
155
 
 
156
    ?line {ok,Bytes62} = 
 
157
        asn1_wrapper:encode('SetOfExternal','XImpExp',[#'XSetExp'{bool = true, os = "kalle"},
 
158
                                                 #'XSetExp'{bool = true, os = "kalle"}]),
 
159
    ?line {ok,[{'XSetExp',[107,97,108,108,101],true},{'XSetExp',[107,97,108,108,101],true}]} = 
 
160
        asn1_wrapper:decode('SetOfExternal','XImpExp',lists:flatten(Bytes62)),
 
161
 
 
162
    ?line {ok,Bytes63} = 
 
163
        asn1_wrapper:encode('SetOfExternal','XExpExp',[#'XSetExp'{bool = true, os = "kalle"},
 
164
                                                 #'XSetExp'{bool = true, os = "kalle"}]),
 
165
    ?line {ok,[{'XSetExp',[107,97,108,108,101],true},{'XSetExp',[107,97,108,108,101],true}]} = 
 
166
        asn1_wrapper:decode('SetOfExternal','XExpExp',lists:flatten(Bytes63)),
 
167
 
 
168
 
 
169
    
 
170
    
 
171
    ok.