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

« back to all changes in this revision

Viewing changes to lib/asn1/test/testSeqExternal.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(testSeqExternal).
 
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
 
 
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}).
 
35
 
 
36
 
 
37
compile(Config,Rules,Options) ->
 
38
 
 
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).
 
44
 
 
45
 
 
46
 
 
47
main(_Rules) ->
 
48
 
 
49
    ?line {ok,Bytes11} = 
 
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)),
 
53
 
 
54
    ?line {ok,Bytes12} = 
 
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)),
 
58
 
 
59
    ?line {ok,Bytes13} = 
 
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)),
 
63
 
 
64
    
 
65
 
 
66
    ?line {ok,Bytes21} = 
 
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)),
 
70
 
 
71
    ?line {ok,Bytes22} = 
 
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)),
 
75
 
 
76
    ?line {ok,Bytes23} = 
 
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)),
 
80
 
 
81
 
 
82
    
 
83
    ?line {ok,Bytes31} = 
 
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)),
 
87
 
 
88
    ?line {ok,Bytes32} = 
 
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)),
 
92
 
 
93
    ?line {ok,Bytes33} = 
 
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)),
 
97
 
 
98
 
 
99
    
 
100
    ?line {ok,Bytes41} = 
 
101
        asn1_wrapper:encode('SeqExternal','SeqXSet1',
 
102
                      #'SeqXSet1'{bool = true, 
 
103
                                  int = 66,
 
104
                                  set = #'XSet1'{bool1 = true, 
 
105
                                                 int1 = 77,
 
106
                                                 set1 = #'XSetIn'{boolIn = false, 
 
107
                                                                  intIn = 88}}}),
 
108
    ?line {ok,{'SeqXSet1',{'XSet1',true,77,{'XSetIn',false,88}},true,66}} = 
 
109
        asn1_wrapper:decode('SeqExternal','SeqXSet1',lists:flatten(Bytes41)),
 
110
 
 
111
 
 
112
 
 
113
    ?line {ok,Bytes42} = 
 
114
        asn1_wrapper:encode('SeqExternal','SeqXSet2',
 
115
                      #'SeqXSet2'{bool = true, 
 
116
                                  int = 66,
 
117
                                  set = #'XSet1'{bool1 = true, 
 
118
                                                 int1 = 77,
 
119
                                                 set1 = #'XSetIn'{boolIn = false, 
 
120
                                                                  intIn = 88}}}),
 
121
    ?line {ok,{'SeqXSet2',true,{'XSet1',true,77,{'XSetIn',false,88}},66}} = 
 
122
        asn1_wrapper:decode('SeqExternal','SeqXSet2',lists:flatten(Bytes42)),
 
123
 
 
124
    ?line {ok,Bytes43} = 
 
125
        asn1_wrapper:encode('SeqExternal','SeqXSet3',
 
126
                      #'SeqXSet3'{bool = true, 
 
127
                                  int = 66,
 
128
                                  set = #'XSet1'{bool1 = true, 
 
129
                                                 int1 = 77,
 
130
                                                 set1 = #'XSetIn'{boolIn = false, 
 
131
                                                                  intIn = 88}}}),
 
132
    ?line {ok,{'SeqXSet3',true,66,{'XSet1',true,77,{'XSetIn',false,88}}}} = 
 
133
        asn1_wrapper:decode('SeqExternal','SeqXSet3',lists:flatten(Bytes43)),
 
134
 
 
135
 
 
136
    
 
137
 
 
138
    ok.
 
139
 
 
140