~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2010-03-09 17:34:57 UTC
  • mfrom: (10.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100309173457-4yd6hlcb2osfhx31
Tags: 1:13.b.4-dfsg-3
Manpages in section 1 are needed even if only arch-dependent packages are
built. So, re-enabled them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%
 
2
%% %CopyrightBegin%
 
3
%% 
 
4
%% Copyright Ericsson AB 2008-2009. 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
%%-------------------------------------------------------------------
 
21
 
 
22
-module(testX420).
 
23
 
 
24
-export([compile/3, ticket7759/2]).
 
25
 
 
26
-include("test_server.hrl").
 
27
 
 
28
 
 
29
compile(Erule,Options,Config) ->
 
30
    
 
31
    Specs = specs(),
 
32
    ?line 99 = length(Specs),
 
33
    ?line ok = compile_loop(Erule,Specs,Options,Config).
 
34
        
 
35
            
 
36
 
 
37
compile_loop(_Erule,[],_Options,_Config) ->
 
38
    ok;
 
39
compile_loop(Erule,[Spec|Specs],Options,Config) 
 
40
  when Erule == ber; Erule == ber_bin; Erule == ber_bin_v2;
 
41
       Erule == per ->
 
42
 
 
43
    ?line DataDir = ?config(data_dir,Config),
 
44
    ?line OutDir = ?config(priv_dir,Config),
 
45
  
 
46
    case asn1ct:compile(DataDir ++ "/x420/" ++ Spec,[Erule,{outdir,OutDir},
 
47
                                         {i,OutDir}]++Options) of
 
48
        ok ->
 
49
            compile_loop(Erule,Specs,Options,Config);
 
50
        Error ->
 
51
            Error
 
52
    end;
 
53
compile_loop(Erule,_Specs,_Options,_Config) ->
 
54
    ok.%%{skip,io_lib:format("Not tested for ~p",[Erule])}.
 
55
 
 
56
 
 
57
specs() ->
 
58
    ["ACSE-1", "AuthenticationFramework", "BasicAccessControl",
 
59
     "CertificateExtensions", "Character-Coding-Attributes",
 
60
     "Character-Presentation-Attributes", "Character-Profile-Attributes",
 
61
     "Colour-Attributes", "DOR-definition", "DSAOperationalAttributeTypes",
 
62
     "Default-Value-Lists", "DirectoryAbstractService",
 
63
     "DirectoryAccessProtocol", "DirectoryInformationShadowProtocol",
 
64
     "DirectoryOperationalBindingManagementProtocol",
 
65
     "DirectoryOperationalBindingTypes", "DirectoryProtectionMappings",
 
66
     "DirectoryShadowAbstractService", "DirectorySystemProtocol",
 
67
     "DistributedOperations", "Document-Profile-Descriptor",
 
68
     "EnhancedSecurity", "External-References", "GULSProtectionMappings",
 
69
     "GenericProtectingTransferSyntax", "Geo-Gr-Coding-Attributes",
 
70
     "Geo-Gr-Presentation-Attributes", "Geo-Gr-Profile-Attributes",
 
71
     "GulsSecurityExchanges", "GulsSecurityTransformations",
 
72
     "HierarchicalOperationalBindings", "IPMSAbstractService",
 
73
     "IPMSAutoActionTypes", "IPMSExtendedBodyPartTypes",
 
74
     "IPMSExtendedBodyPartTypes2", "IPMSExtendedVoiceBodyPartType",
 
75
     "IPMSFileTransferBodyPartType", "IPMSForwardedContentBodyPartType",
 
76
     "IPMSForwardedReportBodyPartType", "IPMSFunctionalObjects",
 
77
     "IPMSHeadingExtensions", "IPMSInformationObjects",
 
78
     "IPMSMessageStoreAttributes", "IPMSObjectIdentifiers",
 
79
     "IPMSObjectIdentifiers2", "IPMSSecurityExtensions", "IPMSUpperBounds",
 
80
     "ISO-STANDARD-9541-FONT-ATTRIBUTE-SET", "ISO8571-FTAM", "ISO9541-SN",
 
81
     "Identifiers-and-Expressions", "InformationFramework",
 
82
     "Interchange-Data-Elements", "Layout-Descriptors", "Link-Descriptors",
 
83
     "Location-Expressions", "Logical-Descriptors", "MHSObjectIdentifiers",
 
84
     "MHSProtocolObjectIdentifiers", "MSAbstractService",
 
85
     "MSAccessProtocol", "MSGeneralAttributeTypes",
 
86
     "MSGeneralAutoActionTypes", "MSMatchingRules", "MSObjectIdentifiers",
 
87
     "MSUpperBounds", "MTAAbstractService", "MTSAbstractService",
 
88
     "MTSAbstractService88", "MTSAccessProtocol", "MTSObjectIdentifiers",
 
89
     "MTSUpperBounds", "Notation", "ObjectIdentifiers",
 
90
     "OperationalBindingManagement", "PKCS7", "PKCS7BodyPartType",
 
91
     "Protected-Part-Descriptors", "ProtocolObjectIdentifiers",
 
92
     "Raster-Gr-Coding-Attributes", "Raster-Gr-Presentation-Attributes",
 
93
     "Raster-Gr-Profile-Attributes", "Reliable-Transfer-APDU",
 
94
     "Remote-Operations-Abstract-Syntaxes", 
 
95
     "Remote-Operations-Generic-ROS-PDUs",
 
96
     "Remote-Operations-Information-Objects-extensions",
 
97
     "Remote-Operations-Information-Objects",
 
98
     "Remote-Operations-Realizations",
 
99
     "Remote-Operations-Useful-Definitions", "SelectedAttributeTypes",
 
100
     "SeseAPDUs", "SpkmGssTokens", "Style-Descriptors", "Subprofiles",
 
101
     "Temporal-Relationships", "Text-Units", "UpperBounds",
 
102
     "UsefulDefinitions", "Videotex-Coding-Attributes"].
 
103
 
 
104
ticket7759(_Erule,_Config) ->
 
105
    Encoded = encoded_msg(),
 
106
    io:format("Testing ticket7759 ...~n",[]),
 
107
    ?line {ok, ContentInfo} = asn1_wrapper:decode('PKCS7','ContentInfo',Encoded),
 
108
    ?line {'ContentInfo',_Id,PKCS7_content} = ContentInfo,
 
109
    ?line {ok,_} = asn1_wrapper:decode('PKCS7','SignedData',PKCS7_content),
 
110
    ok.
 
111
 
 
112
 
 
113
encoded_msg() ->
 
114
    <<48,128,6,9,42,134,72,134,247,13,1,7,2,160,128,48,128,2,1,1,49,11,48,9,6,5,43,14,3,2,26,5,0,48,128,6,9,42,134,72,134,247,13,1,7,1,160,128,36,128,0,0,0,0,0,0,  49,130,1,192,48,130,1,188,2,1,1,48,50,48,38,49,17,48,15,6,3,85,4,3,12,8,65,100,109,105,110,67,65,49,49,17,48,15,6,3,85,4,10,12,8,69,82,73,67,83,83,79,78,2,8,15,151,245,186,21,23,240,96,48,9,6,5,43,14,3,2,26,5,0,160,129,229,48,17,6,10,96,134,72,1,134,248,69,1,9,2,49,3,19,1,51,48,17,6,10,96,134,72,1,134,248,69,1,9,3,49,3,19,1,51,48,24,6,9,42,134,72,134,247,13,1,9,3,49,11,6,9,42,134,72,134,247,13,1,7,1,48,28,6,9,42,134,72,134,247,13,1,9,5,49,15,23,13,48,56,49,50,49,48,48,57,53,52,50,51,90,48,28,6,10,96,134,72,1,134,248,69,1,9,7,49,14,19,12,49,53,50,56,49,52,50,52,48,57,53,53,48,32,6,10,96,134,72,1,134,248,69,1,9,5,49,18,4,16,165,115,177,71,78,88,239,113,78,56,98,98,18,202,217,235,48,32,6,10,96,134,72,1,134,248,69,1,9,6,49,18,4,16,227,174,230,251,43,153,252,65,11,93,231,83,34,18,55,46,48,35,6,9,42,134,72,134,247,13,1,9,4,49,22,4,20,218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9,48,13,6,9,42,134,72,134,247,13,1,1,1,5,0,4,129,128,106,233,116,125,140,51,133,173,63,41,54,138,214,211,89,215,169,125,98,77,16,222,216,240,211,79,125,111,87,186,73,63,253,204,107,102,177,63,174,197,224,212,231,172,149,246,33,68,223,67,102,93,64,152,152,5,216,102,247,134,36,197,150,236,57,77,56,138,95,71,204,31,23,149,241,213,78,172,165,249,100,187,12,45,19,57,67,120,54,63,15,239,41,217,127,61,254,60,201,104,68,3,135,214,206,93,253,255,192,94,56,107,68,210,57,61,41,249,47,156,130,244,52,12,163,216,236,69,0,0,0,0,0,0>>.